[Python-Dev] Python-3000 upgrade path

Guido van Rossum guido at python.org
Tue Mar 6 23:22:39 CET 2007

On 2/27/07, glyph at divmod.com <glyph at divmod.com> wrote:
> 2to3 should take great care _tell_ you when it fails.  One concern I have is that the source translation may subtly alter the *semantics* of unit test code, so that the tests are no longer effective and do not provide adequate coverage.  I think this is an extremely unlikely edge case, but a very dangerous one in the event that it does happen.  I don't know of any bugs in 2to3 that will do this at the moment, but then it's hardly the final release.

Actually, this did happen with the iterkeys -> keys translation. A few
unittests were reduced to pure nonsense by this. Most of those failed,
but it was definitely a hassle finding out what went wrong (in part
because I was too greedy and checked in a bunch of converted code
without any review at all). Lesson learned I would say. Fortunately,
this is a case where 2.6's Py3k warning mode should compensate.

> Also, the limitations of 2to3 should be very well documented, so that when it does tell you how it has failed, it's clear to the developer what changes to make to the *2.6 source* to cause it to translate correctly, not how to fix up the translated 3.0 code.

I'm hoping Collin will continue his excellent work on 2to3. Hopefully
he'll get help from others in writing docs aimed at teaching the
c.l.py crowd how to use it and what to expect.

> Thanks *very* much to all the python core developers and community members who have been working to make this happen, especially to Neal, Thomas, and Guido for listening intently to all of our concerns at PyCon.

You're welcome. I believe I even got a beer out of it. ;-)

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

More information about the Python-Dev mailing list