smartystreets / smartystreets-python-sdk

The official client libraries for accessing SmartyStreets APIs from Python 2.7 and 3.5
https://smartystreets.com/docs/sdk/python
Apache License 2.0
28 stars 30 forks source link

client.py uses "is not" to check equality with a literal #25

Closed nmaynes closed 3 years ago

nmaynes commented 3 years ago

In the Python sdk, version 4.7.2, client.py will raise a SyntaxWarning on Python 3.8.x. The add_parameter method uses the syntax is not which checks for identity not equality.

@staticmethod
    def add_parameter(request, key, value):
        if value and value is not 'none':
            request.parameters[key] = value

The code should be updated to:

@staticmethod
    def add_parameter(request, key, value):
        if value and value != 'none':
            request.parameters[key] = value

I am happy to create a PR to fix this issue. From what I can see the syntax appears in at least 4 places.