Best Practices for Compatible Python 2 and 3 Code

Posted by Bob on Wed 22 March 2017 in Tools • Tagged with 2vs3, tox, six, python-modernize, porting, future, 2to3, coverage, futurize, caniusepython3, pip, Requests, Werkzeug • 3 min read

95% of most popular Python packages support Python 3. Maybe you are lucky and get to start fresh using Python 3. However as of last year Python 2.7 still reigns supreme in pip installs and at a lot of places 2.x is the only version you get to work in. I think writing Python 2 and 3 compatible code is an important skill, so lets check what it entails.


Continue reading