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

Glyph glyph at twistedmatrix.com
Fri Dec 9 19:39:20 CET 2011

On Dec 9, 2011, at 12:43 AM, Guido van Rossum 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.
> Even though 2to3 was my idea, I am gradually beginning to appreciate this approach. I skimmed the docs for "six" and liked it.

Actually, maybe I like it a bit better than I thought.

The biggest issue for the single-codebase approach is 'except ... as ...'.  Peppering one's codebase with calls to sys.exc_info() can be a real performance problem, especially on PyPy.  Not to mention how ugly it is.  For some reason I thought that this syntax was only supported by 2.7 and up; I see now that it's 2.6 and up.

This is still a problem for 2.5 support, of course, but 2.6-only may not be too far away for many projects; Twisted's support schedule for Python versions typically follows Ubuntu's, which means that we might be able to drop 2.5 as early as 2013! :).  Even in the plans that involve 2to3 though, "drop everything prior to 2.6" was always supposed to be step 0, so "single codebase" adds much less of a burden than I thought.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20111209/ae1e198f/attachment.html>

More information about the Python-Dev mailing list