[Python-Dev] Proposal for new 2to23 tool

Guido van Rossum guido at python.org
Mon Nov 12 20:44:50 CET 2007


On Nov 11, 2007 7:24 PM, Jan Claeys <lists at janc.be> wrote:
> Graham wants to convert his code such that it works on both Python 2.x
> (probably even early versions of it?) & Python 3.x.  Not 2 instances of
> code, but one source that works on both 2.x and 3.x...

The transition strategy for 3.0 explicitly excludes this possibility.

For example, you couldn't catch exceptions with an error variable,
because the except clause syntax changed. You couldn't use print
except to print a single string. You couldn't use unicode string
literals; you couldn't distinguish between text and binary data in a
meaningful way.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list