Applications Google
Menu principal

Post a Comment On: Only Python

"Still baffled by the Python 2/3 discussions"

1 Comment -

1 – 1 of 1
Blogger Andrew Dalke said...

It's one of the places where the Python-dev isn't aligned with rest of the world. The new "consensus" is internal. I agree with you; I'm one of many who suggest that people write in the source-compatible subset of Python 2/3.

For example, Lennart Regebro at http://python3porting.com/noconv.html writes "Although the official documentation for Python 3 discourages writing code for both Python 2 and Python 3, in some cases it is desirable."

Cannon, in the 3.2 release's "pyporting" (see https://docs.python.org/3.2/howto/pyporting.html ) suggests three alternatives, (3to2, source compatible, or 2to3) but there is no clear suggestion for which one, though a slight preference for using 3to2. The source compatible option is described as "counter-intuitive".

The 3.2 pyporting also says that the choice of approach is "will be a per-project decision", while the new version is much more direct: "both Python 2 & 3 simultaneously", without listing the built-time 2to3 or 3to2 options.

The projects that I know of which did the transition use 2/3 compatible code, often with the help of six or similar tools.

12:17 PM

Spammers: none shall pass.
You can use some HTML tags, such as <b>, <i>, <a>

Comments on this blog are restricted to team members.

You will be asked to sign in after submitting your comment.
Please prove you're not a robot