Special offers now — see discounted courses.
day
:
hour
:
min
:
sec
See special offers
Migrating from Python 2.7 to Python 3

Migrating from Python 2.7 to Python 3

2h 46mIntermediate2020-08-18

Authors

Steven Lott

Steven Lott

Software Developer and Architect

Course details

Are you still using Python 2.7? Official support for this version ended in January 2020; upgrading is more important than ever. If you've been meaning to make the jump to Python 3, but aren't entirely sure how to use the new features—or how to migrate your existing code—then this course is for you. Instructor Steven Lott illuminates the differences between the two Python versions, going over changes to built-in Python functions and the Python standard library. He also walks through a number of ways to convert your Python 2.7 applications to Python 3, including manual rewrite and automated migration using packages like six, pytest, and 2to3. Along the way, Steven shares his own experiences with this transition and offers helpful suggestions for enhancing the overall quality and performance of your code.

Topics include:
Comparing the two versions
Syntax changes introduced with Python 3
Changes to built-in functions
Changes to the Python standard library
Manually vs. automatically migrating to Python 3
Using six to handle class definitions
Using six with standard library changes
Unit testing with pytest
Automating migrations with 2to3

Skills covered

MigratingPythonProgramming LanguagesOpen SourceSoftware Development

Concepts

0. Introduction

  • 01 - Getting started with migrating Python

1. Python 2 and Python 3

  • 02 - The challenges of migrating from Python 2 to 3
  • 03 - Historical overview
  • 04 - The official how to guide
  • 05 - The obvious differences in Python 3

2. Feature Comparisons

  • 06 - The language syntax changes
  • 07 - Syntax changes that have to wait
  • 08 - Changes to the internal types
  • 09 - Changes to Python built-in functions
  • 10 - Changes to the Python standard library

3. Conversion Strategies - Manual or Automated

  • 11 - Navigation among the strategies
  • 12 - Readying the toolbox
  • 13 - Manual rewrite
  • 14 - Automated migration via 2to3
  • 15 - Final cleanup

4. Using Six

  • 16 - Overview of the features of six
  • 17 - Syntax wrapping with six
  • 18 - Handling class definitions with six
  • 19 - Using six to manage built-in functions
  • 20 - Using six with standard library changes

5. Using Pytest for Unit Testing

  • 21 - Overview of the goals of unit testing
  • 22 - Capturing Python 2 features as tests
  • 23 - Mocking and monkey patching
  • 24 - Design for testability
  • 25 - Bugs - Fix or preserve

6. Using 2to3 to Automate Conversion

  • 26 - Overview of the features of 2to3
  • 27 - Syntax and class definitions
  • 28 - Built-ins and library migrations
  • 29 - Test automation with tox
  • 30 - Type checking with mypy

Conclusion

  • 31 - Final thoughts
  • 32 - Continuing on with Python 3

About us

LyndaKade is a leading learning platform that helps people learn business, software, technology, and creative skills to achieve personal and professional goals.

Phone numberAparat ChannelTelegram SupportTelegram ChannelInstagram Page

All rights to this site belong to LyndaKade.

Terms of Service|Privacy Policy

نماد الکترونیک enamad در صورت اتصال با آی‌پی داخل کشور، نمایش داده خواهد شد.
logo-samandehi - لوگو ساماندهی
Zarinpal
Zibal