Python 2 and Python 3 dual development

后端 未结 5 639
暖寄归人
暖寄归人 2020-11-27 18:14

I\'m just starting a new Python project, and ideally I\'d like to offer Python 2 and 3 support from the start, with minimal developmental overhead. My question is, what is t

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-27 19:08

    If you need support for Python 2.5 or earlier, using Distribute and it's 2to3 integration is typically the best way to go. But if you only need to support Python 2.6 or later, I would make the code run under Python 2 and Python 3 without conversion. I would also use the six library to make this easier.

提交回复
热议问题