[Python-Dev] PEP-498: Literal String Formatting

Alexander Walters tritium-list at sdamon.com
Sat Aug 8 17:12:51 CEST 2015


... Its adding meaning to something that was intentionally meaningless.  
Not using u'' has the obvious, immediate benefit of not caring what u'' 
means in python 3, so one can continue to write polyglot code.  Since 
you are adding new semantics to python 3, use a different letter so that 
it just breaks in python 2, instead of having different meanings between 
versions.

Python 2 is still the dominant python.

On 8/8/2015 11:07, Nick Coghlan wrote:
> On 9 August 2015 at 00:05, Alexander Walters <tritium-list at sdamon.com> wrote:
>> Please do not change the meaning of the vestigial U''.  It was re-added to
>> the language to fix a problem, rebinding it to another meaning introduces
>> new problems.  We have plenty of other letters in the alphabet to use.
> It's actually being used in the same sense we already use it - I'm
> just adding a new compile time use case where the distinction matters
> again, which we haven't previously had in Python 3. (The usage in this
> PEP is fairly closely analogous to WSGI's distinction between native
> strings, text strings and binary strings, which matters for hybrid
> Python 2/3 code, but not for pure Python 3 code)
>
> It would certainly be *possible* to use a different character for that
> aspect of the PEP, but it would be additional work without any obvious
> gain.
>
> Cheers,
> Nick.
>
> P.S. I hop on the plane for the US in a few hours, so I'll be aiming
> to be bad at responding to emails until the 17th or so. We'll see how
> well I stick to that plan :)
>



More information about the Python-Dev mailing list