mattlisiv / newsapi-python

A Python Client for News API
MIT License
376 stars 130 forks source link

str and unicode #23

Closed titocosta closed 4 years ago

titocosta commented 5 years ago

In order to work properly with parameters passed as unicode strings, the correct way to check if a parameter is a string in Python 2.x in newsapi_client.py is:

if isinstance(q, basestring)

instead of:

if type(q) == str

basestring includes both str and unicode.

See python docs for reference.

mattlisiv commented 5 years ago

Hi @titocosta ,

Thanks for reporting this. I will add to add this as an enhancement.

Matt

mattlisiv commented 4 years ago

Completed with #40