@@ -48,7 +48,7 @@ def get_top_headlines(self, q=None, sources=None, language=None, country=None, c
4848 if type (q ) == str :
4949 payload ['q' ] = q
5050 else :
51- raise TypeError ('keyword/phrase q param should be a str ' )
51+ raise TypeError ('keyword/phrase q param should be a string ' )
5252
5353 # Sources
5454 if (sources is not None ) and ((country is not None ) or (category is not None )):
@@ -59,7 +59,7 @@ def get_top_headlines(self, q=None, sources=None, language=None, country=None, c
5959 if type (sources ) == str :
6060 payload ['sources' ] = sources
6161 else :
62- raise TypeError ('sources param should be a str ' )
62+ raise TypeError ('sources param should be a string ' )
6363
6464 # Language
6565 if language is not None :
@@ -94,7 +94,7 @@ def get_top_headlines(self, q=None, sources=None, language=None, country=None, c
9494 # Page Size
9595 if page_size is not None :
9696 if type (page_size ) == int :
97- if page_size >= 0 and page_size <= 100 :
97+ if 0 <= page_size <= 100 :
9898 payload ['pageSize' ] = page_size
9999 else :
100100 raise ValueError ('page_size param should be an int between 1 and 100' )
@@ -227,7 +227,7 @@ def get_everything(self, q=None, sources=None, domains=None, from_param=None, to
227227 # Page Size
228228 if page_size is not None :
229229 if type (page_size ) == int :
230- if page_size >= 0 and page_size <= 100 :
230+ if 0 <= page_size <= 100 :
231231 payload ['pageSize' ] = page_size
232232 else :
233233 raise ValueError ('page_size param should be an int between 1 and 100' )
0 commit comments