Congratulations on upgrading to Python 3: now that you’ve upgraded, what features should you start embracing and what old habits should you leave behind?
In this tutorial we’ll attempt to take our Python 2-focused brains and reconfigure them to think like Python 3 does. If you feel like you’re writing Python 3 code while still thinking in terms of Python 2, this tutorial is for you.
We’ll over a dozen examples of working Python 2 code and refactor these bits of code to embrace new Python 3 features that are often overlooked after upgrading.
We’ll cover:
You’ll walk out of this tutorial with hands-on Python 3 refactoring experience and more exercises to do when you go home.
Note: This tutorial is for folks who’ve already migrated their Python 2 code to Python 3 and will drop (or have dropped) Python 2 support. We will not cover the upgrading process and we will not cover working with code that works in both Python 2 and Python 3.