portable unicode literals
Duncan Booth
duncan.booth at invalid.invalid
Tue Oct 16 04:44:56 EDT 2012
Alex Strickland <sscc at mweb.co.za> wrote:
> On 2012/10/15 03:05 PM, Ulrich Eckhardt wrote:
>
>> This actually came as a surprise to me, I assumed that using b'' I could
>> portably create a byte string (which is true) and using u'' I could
>> portably create a unicode string (which is not true). This feature would
>> help porting code between both versions. While this is a state I can
>> live with, I wonder what the rationale for this is.
>>
>> !puzzled thanks
>
> u'' is legal in 3.3 again.
>
and if you want it to work in 3.1 and 3.2 there is the uprefix import hook:
https://bitbucket.org/vinay.sajip/uprefix
--
Duncan Booth http://kupuguy.blogspot.com
More information about the Python-list
mailing list