This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Rewrite of Python 2/3 porting HOWTO
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: barry, brett.cannon, python-dev, serhiy.storchaka, tshepang
Priority: low Keywords: patch

Created on 2014-11-21 20:03 by brett.cannon, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pyporting.diff brett.cannon, 2014-11-21 20:03 review
pyporting.diff brett.cannon, 2014-11-28 15:42 Addresses Serhiy's comments review
Messages (5)
msg231496 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2014-11-21 20:03
This is a rewrite of the Python 2/3 porting HOWTO to describe how to make code be compatible with both Python 2 & 3. To see it rendered for easier reading, see https://gist.github.com/brettcannon/91ff264ae549315706f6
msg231498 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-11-21 20:37
Why you have removed many sections: about subclassing from object, using io classes, comparison of bytes with unicode objects, the use of warnings and -b and -3 options and other subtle details?
msg231525 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2014-11-22 19:18
I removed a bunch of sections for two reasons. One is they are redundant. If you follow the HOWTO and actually read What's New then you will get a bunch of those same details anyway. The tools will also handle the details for you and so you really don't have to worry about them (and they document them already). And Pylint will warn you when you have not taken care of them. So having a fourth place listing the fact you need to subclass object is simply a waste.

Second is accidental FUD. If you have a huge list of things to watch out for then you are going to end up scaring people off by making them feel intimidated at the work ahead of them. But if you reframe the whole thing as "just follow this TODO list and you will be fine" you can make people realize that most things are simply not a big deal.

But the point about telling people to run with -bb and -3 and a couple of minor comments are valid and I will toss some of them back in.
msg231816 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2014-11-28 15:42
I addressed Serhiy's comments and added in some bits that I initially took off (-bb, -3, str.__mod__, io.open). Also clarified a couple of things.
msg232195 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-12-05 16:01
New changeset 55b94462ca7f by Brett Cannon in branch '3.4':
Issue #22914: Update the Python 2/3 porting HOWTO to describe a more
https://hg.python.org/cpython/rev/55b94462ca7f
History
Date User Action Args
2022-04-11 14:58:10adminsetgithub: 67103
2014-12-05 17:57:51berker.peksagsetstage: patch review -> resolved
2014-12-05 16:02:07brett.cannonsetstatus: open -> closed
resolution: fixed
2014-12-05 16:01:57python-devsetnosy: + python-dev
messages: + msg232195
2014-12-02 16:58:41tshepangsetnosy: + tshepang
2014-11-28 15:42:39brett.cannonsetfiles: + pyporting.diff

messages: + msg231816
2014-11-22 19:18:45brett.cannonsetmessages: + msg231525
2014-11-21 20:37:20serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg231498
2014-11-21 20:18:05barrysetnosy: + barry
2014-11-21 20:15:03berker.peksagsettype: enhancement
stage: patch review
2014-11-21 20:03:53brett.cannonlinkissue22913 superseder
2014-11-21 20:03:19brett.cannoncreate