[Python-Dev] PEP 414 - Unicode Literals for Python 3

Chris McDonough chrism at plope.com
Mon Feb 27 23:01:34 CET 2012


On Mon, 2012-02-27 at 21:43 +0000, Vinay Sajip wrote:
> Chris McDonough <chrism <at> plope.com> writes:
> 
> > It's great to have software that installs easily.  That said, the
> > versions of Python that my software supports is (and has to be) be my
> > choice.
> 
> Of course. And if I understand correctly, that's 2.6, 2.7, 3.2 and later
> versions. I'll ignore 2.5 and earlier in this specific reply.
> 
> > None of them would so much as bat an eyelash if I told them today they
> > had to use Python 3.3 (if it existed in a final released form anyway) to
> > use my software.  It's just a minor drop in the bucket of inconvenience
> > they have to currently withstand.
> 
> Their pain (lacklustre library support and transliterating examples from 2.x to
> 3.x) would be the same under 3.2 and 3.3 (unless for some perverse reason people
> only made libraries work under one of 3.2 and 3.3, but not both).

If I had it to do all over again and a Python 3.X with unicode literals
had been available, I might not have targeted Python 3.2 at all.  I
don't consider that perverse, I just consider it "Python 3 water under
the bridge".  Python 3.0 and 3.1 were this for me; I paid almost no
attention to them at all.  Python 3.2 will be that thing for many other
people.

> > Like I said in an earlier email, u'' literal support is by no means the
> > only issue for people who want to straddle.  But it *is* an issue, and
> > it's incredibly low-hanging fruit with near-zero real-world impact if it
> > is reintroduced.
> 
> But the implication of the PEP is that lack of u'' support is a major hindrance
> to porting, justifying the production of the PEP and this discussion. And it's
> not low-hanging fruit with near-zero real-world impact if we're going to
> deprecate it at some point (which Guido was talking about) - you're just moving
> the pain to a later date, unless we don't ever deprecate.

I personally see no need to deprecate.  I can't conceive of an actual
downside to eternal backwards compatibility here.  All the arguments for
its omission presume that there's some enormous untapped market full of
people yearning for its omission who would be either horrified to see
u'' or whom would not understand it on some fundamental level.  I don't
think such a market actually exists.  However, there *is* a huge market
for people who already understand it instinctively.

> I feel, like some others, that 'xxx' is natural for text, u'xxx' is inelegant by
> comparison, and u('xxx') a little more inelegant still.

Yes, the aesthetics argument seems to be the remaining argument.  I have
no problem with the aesthetics of u'' myself.  But I have no problem
with the aesthetics of u('') for that matter either; if it had been used
as the prevailing style to declare something being text in Python 2 and
it had been omitted I'd be arguing for that instead.  But it wasn't, of
course.

Anyway.  I think I'm done doing the respond-point-for-point thing; it's
becoming diminishing returns.

- C




More information about the Python-Dev mailing list