Finished porting 30 repos to python 3 AMA
Most changes are easy to fix automatically.
✅Print statements
✅Relative to absolute imports
✅Filter/map/dict.items/apply/range
✅Standard library reorganization
✅Exception catching syntax
A few things were surprising:

✅Changes to division were rare (nobody relied on the old integer division).
✅Python 3.3 introduced hash randomization!
✅namedtuples lost __dict__ as a member.
✅In Python 2 `None < 0` is True. In 3, `None < 0` raises an error.
🧵Disambiguating bytes and strings was the hardest part (especially when working with protobufs).
I wrote this shell script to automatically apply changes using futurize ( https://python-future.org/futurize.html ) that make code Python3 with Py2-reverse compatibility while running tests on changes and documenting them with Git. It worked well for me. https://github.com/tdhopper/auto-futurize
You can follow @tdhopper.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled:

By continuing to use the site, you are consenting to the use of cookies as explained in our Cookie Policy to improve your experience.