[Python-Dev] Adding features to 2to3... cpython/default right? can I backport to 2.7?

Benjamin Peterson benjamin at python.org
Thu Dec 22 03:08:49 CET 2011


2011/12/21 Gregory P. Smith <greg at krypto.org>:
> I have some features I need to add to lib2to3 to make it more useful for our
> purposes at work supporting our massive code base in a Python 2 to 3
> transition. Which tree should I develop these and check these into?
>
> cpython/default?
>
> Can I backport this to 3.2 and 2.7?  It counts as a feature addition which
> is normally a no-no for backports.  But in this case I'm enhancing 2to3
> which is a useful tool.

You may backport things for 2to3. It's exempt from feature freeze.

>
> No big deal to me _personally_ if I can't backport from 3.3
> (cpython/default) as I'd apply the changes to our copy at work internally
> but it seems wise to me for us to keep enhancing and improving 2to3 in a
> Python 2.x/3.x release independent manner to make people's conversions
> easier.
>
> The features I want to commit (all pretty easy additions) are command line
> flag / constructor option support for:
>   1) writing output files to a different directory tree instead of
> overwriting the input file.
>   2) modifying the output filename by altering the suffix (.py -> .py3 for
> example)
>   3) always writing output files even if there were no changes to make
> (useful in combination with the above to effectively act as a "copy library
> X to this directory converting it to python 3 syntax along the way").
>
> The old http://hg.python.org/2to3/ tree exists but it really looks like an
> out of date version.

Indeed; I should probably just delete it.



-- 
Regards,
Benjamin


More information about the Python-Dev mailing list