tubeshowcase●1,194,391 videos♡ My collection 0
← Learn to Code

Learn to Code2:37:46

Tutorial: Mike Müller - Migration from Python 2 to 3

PyCon US ↗

From the creator

Presented by: Mike Müller Python 2 reached end of life (EOL). However, there are still many projects that use Python 2. Staying with Python 2 is certainly no long-term option for most projects. Porting a larger program to Python 3 brakes backward compatibility with Python 2. One solution for this problem is the single-source approach that results in source code that runs with Python 2 and 3 without any changes. This tutorial provides a short overview over the most important differences between Python 2 and 3. After looking at different approaches for Python 3 support, the focus will be on writing single-source programs with python-future. You will learn how to port to Python 3 without loosing Python 2 support. Finally dropping Python 2 support will get as simple as removing a few imports. The content of this tutorial is inspired by questions I received from participants in trainings about how to smoothly transition from Python 2 to Python 3. Making Python 2 working as much as possible as Python 3 seems the best option to me. You are encouraged to bring your questions about this topic. I teach about this topic on a regular basis in my trainings. Being a full-time profession trainer, I have plenty opportunity to get involved with many programmers who have to deal with this problem. Software Requirements You will need Python 3.8 installed on your laptop. Python 3.6/3.7 should also work. You also need Python 2.7 installed to test if the code runs with Python 2 and Python 3.

Published 2020-05-13 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code