How are you planning on handling the migration to Python 3?

前端 未结 7 1838
[愿得一人]
[愿得一人] 2020-12-08 02:02

I\'m sure this is a subject that\'s on most python developers\' minds considering that Python 3 is coming out soon. Some questions to get us going in the right direction:

7条回答
  •  清歌不尽
    2020-12-08 02:49

    The Django project uses the library six to maintain a codebase that works simultaneously on Python 2 and Python 3 (blog post).

    six does this by providing a compatibility layer that intelligently redirects imports and functions to their respective locations (as well as unifying other incompatible changes).

    Obvious advantages:

    • No need for separate branches for Python 2 and Python 3
    • No conversion tools, such as 2to3.

提交回复
热议问题