Skip to content

Conversation

@roaldnefs
Copy link
Contributor

Fix Python 3 compatibility, the following issues were found using 2to3:

  • Usage of dict.items() in messagebird/base.py.
  • A print statement in examples/message_create.py.

This PR also adds the classifiers to setup.py in order to add the 'Programming Language' to the Messagebird PyPi project page.

Add Python classifiers to setup.py to include Python, Python 2 and
Python 3. For more information about classifiers see:
https://www.python.org/dev/peps/pep-0301/#distutils-trove-classification
In Python 3 `items()` return iterators, and a list is never fully
build. The `items()` method in Python 3 works like `viewitems()` in
Python 2.7.

For more information see:
https://docs.python.org/3/whatsnew/3.0.html#views-and-iterators-instead-of-lists
Update print to function in `examples/message_create.py`. The `print`
statement becomes the `print()` function in Python 3.
@epels
Copy link
Contributor

epels commented Oct 31, 2018

Hi @roaldnefs, thanks for submitting this pull request! Can you confirm this is not a breaking change?

@roaldnefs
Copy link
Contributor Author

Hi @roaldnefs, thanks for submitting this pull request! Can you confirm this is not a breaking change?

Yes, I can confirm that. I've tested the changes locally using Python 3.6 and Python 2.7.

@epels
Copy link
Contributor

epels commented Nov 2, 2018

@roaldnefs Great, thank you! 💯

@epels epels merged commit ab45d35 into messagebird:master Nov 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants