[Python-3000] Making 2to3 installable

Guido van Rossum guido at python.org
Mon Mar 17 00:20:59 CET 2008


On Sun, Mar 16, 2008 at 6:12 PM, Gregory P. Smith <greg at krypto.org> wrote:
> On 3/16/08, Nick Coghlan <ncoghlan at gmail.com> wrote:
> > Guido van Rossum wrote:
> > > On Sun, Mar 16, 2008 at 4:22 PM, "Martin v. Löwis" <martin at v.loewis.de>
> wrote:
> >
> > >>  People would try the process on their development machines, and change
> > >>  the code until it actually runs under both versions.
> > >>
> > >>  I'll be using my sprinting time to find out whether that approach
> > >>  can actually work.
> > >
> > > That would be good. I agree with the ideal process, but I doubt that
> > > it will realistically work exactly like that, so I expect that calling
> > > 2to3 upon install is just going to cost a lot of CPU time and then
> > > produce a non-working install.
> >
> >
> > I was thinking that a comment based "directives" approach ala doctest
> > might help with some of the trickier 2->3 migrations. For example,
> > allowing someone to write an explicit conversion for a particular line:
> >
> >    for x, y, in my_izip(s1, s2): # 2to3: for x, y, in zip(s1, s2):
> >
> > (Dodgy example I know, but it gives the general idea)
>
> thats a good idea.  do we want a comment to contain the alternate code or
> should the comment just indicate which way a particular predefined set of
> known 2to3 difficult things should be interpreted during conversion?
>
> parallel code is nice.  but long lines will become annoying.  this should
> allow for the comment to be on the line below as well maybe?

I think the parallel code idea is too complex. 2to3 doesn't really
think in terms of lines anyway. I think we should just have a
directive to prevent 2to3 from applying a certain fixer to the line
containing the directive.

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


More information about the Python-3000 mailing list