Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31367

Re: portable unicode literals

Path csiph.com!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Duncan Booth <duncan.booth@invalid.invalid>
Newsgroups comp.lang.python
Subject Re: portable unicode literals
Date 16 Oct 2012 08:44:56 GMT
Lines 20
Message-ID <XnsA0EE620C017FFduncanbooth@127.0.0.1> (permalink)
References <t8etk9-5h9.ln1@satorlaser.homedns.org> <mailman.2204.1350308926.27098.python-list@python.org>
Reply-To duncan.booth@suttoncourtenay.org.uk
Mime-Version 1.0
Content-Type text/plain; charset=iso-8859-1
Content-Transfer-Encoding 8bit
X-Trace individual.net YH8CPMhTYAzwB6L5ls/nRgqOi9rSjnkkcsyGwJ1uR6Uvc6ESPdmWQX0H8gm7jmSzWk
Cancel-Lock sha1:Md9pv5OECO2nsnKiN3ACWCTXCQE=
User-Agent Xnews/2006.08.24 Hamster/2.1.0.11
X-Face .C;/v3#w@2k.C(.1v-}d=`|7AQ-%,#A$0ZGtAkLPvuawAM>3#D,pXaAb31%(=Gn2ZZK/Z~fd0y4't5iKK~F":}F2*|\mQYX+BUr4ZM*|+`@o-TKzFGwsJnan{)*b~QJ-Fu^u'$$nYV
Xref csiph.com comp.lang.python:31367

Show key headers only | View raw


Alex Strickland <sscc@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

portable unicode literals Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com> - 2012-10-15 15:05 +0200
  Re: portable unicode literals Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-15 13:26 +0000
  Re: portable unicode literals Dave Angel <d@davea.name> - 2012-10-15 09:32 -0400
  Re: portable unicode literals Alex Strickland <sscc@mweb.co.za> - 2012-10-15 15:41 +0200
    Re: portable unicode literals Duncan Booth <duncan.booth@invalid.invalid> - 2012-10-16 08:44 +0000
  Re: portable unicode literals Serhiy Storchaka <storchaka@gmail.com> - 2012-10-15 20:11 +0300

csiph-web