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

Chris McDonough chrism at plope.com
Thu Dec 8 07:31:56 CET 2011


On Thu, 2011-12-08 at 01:18 -0500, Benjamin Peterson wrote:
> 2011/12/8 Chris McDonough <chrism at plope.com>:
> > On Thu, 2011-12-08 at 01:02 -0500, Benjamin Peterson wrote:
> >> 2011/12/8 Chris McDonough <chrism at plope.com>:
> >> > On the heels of Armin's blog post about the troubles of making the same
> >> > codebase run on both Python 2 and Python 3, I have a concrete
> >> > suggestion.
> >> >
> >> > It would help a lot for code that straddles both Py2 and Py3 to be able
> >> > to make use of u'' literals.
> >>
> >> Helpful or not helpful, I think that ship has sailed. The earliest it
> >> could see the light of day is 3.3, which would leave people trying to
> >> support 3.1 and 3.2 in a bind.
> >
> > Right.. the title does say "readd ... support in 3.3".  Are you
> > suggesting "the ship has sailed" for eternity because it can't be
> > supported in Python < 3.3?
> 
> I'm questioning the real utility of it.

All I can really offer is my own experience here based on writing code
that needs to straddle Python 2.5, 2.6, 2.7 and 3.2 without use of 2to3.
Having u'' work across all of these would mean porting would not require
as much eyeballing as code modified via "from future import
unicode_literals", it would let more code work on 2.5 unchanged, and the
resulting code would execute faster than code that required us to use a
u() function.

What's the case against?

- C





More information about the Python-Dev mailing list