[Python-Dev] readd u'' literal support in 3.3?

Antoine Pitrou solipsis at pitrou.net
Fri Dec 9 11:35:35 CET 2011

On Fri, 9 Dec 2011 15:41:40 +1000
Nick Coghlan <ncoghlan at gmail.com> wrote:
> On Fri, Dec 9, 2011 at 3:33 PM, Chris McDonough <chrism at plope.com> wrote:
> > Even if it weren't slow, I still wouldn't use it to automatically
> > convert code at install time; a single codebase is easier to reason
> > about, and easier to support.  Users send me tracebacks all the time;
> > having them match the source is a wonderful thing.
> Yeah, if single source doesn't work, then I think Antoine's suggested
> way (i.e. convert once, then maintain two distinct branches and
> builds, the way python-dev did for years with the standard library) is
> a more sane option.

My suggestion is actually to convert each time you pull changes from
the 2.x sources. You have three branches:

- the default 2.x branch
- a branch containing changesets which are pristine 2to3 runs over the
  2.x codebase
- a branch containing the modified 3.x code

The 2to3 branch can be updated through an automatic script. Each
changeset should be a child of both the previous 2to3 changeset, and
the 2.x changeset which 2to3 has been run on (in other words, each
changeset - except the first one - is a merge).

Then the changes from the 2to3 branch are simply merged to the 3.x
branch. This is the only manual step, in that you have to fix
potential conflicts and regressions.

(I suppose the strategy can be reversed, i.e. maintain code primarily
in the 3.x branch and use 3to2 to backport them to the 2.x codebase)



More information about the Python-Dev mailing list