Is it worth back porting PEP 3147 to Python < 3.2?

Omer Zak w1 at
Tue Apr 20 21:50:00 BST 2010

On Tue, 2010-04-20 at 15:39 -0400, Barry Warsaw wrote:
> On Apr 20, 2010, at 06:50 AM, Omer Zak wrote:
> >My take of the situation:
> >Yes, please backport PEP 3147 to at least Python 2.7.
> >The rationale: we'll need to support both Python 2.x and Python 3.x for
> >several years, and it will be nice if the same library package can be
> >made to support both 2.x and 3.x.
> >
> >It would also be nice to define a way to specify that a tree of Python
> >2.7 scripts are to be compiled into Python 3.x bytecode, by specifying
> >that the compilation process has first to run 2to3
> >( on the
> >Python scripts and actually compile the 2to3's output.
> If we can come up with a reasonable way to make that work, then I'd be in
> favor of back porting the PEP to Python 2.x.

Julian Andres Klode suggested a way to do so.
DISCLAIMER: I didn't verify that it actually works.

On Tue, 2010-04-20 at 07:47 +0200, Julian Andres Klode wrote:
> Use build_py_2to3 from distutils.command.build_py, for example:
>     if sys.version_info[0] == 3:
>         from distutils.command.build_py import build_py_2to3
>         cmdclass['build_py'] = build_py_2to3
$ python
>>> type(type(type))
<type 'type'>          My own blog is at
My opinions, as expressed in this E-mail message, are mine alone.
They do not represent the official policy of any organization with which
I may be affiliated in any way.

More information about the ubuntu-devel mailing list