Re: portable unicode literals

2012-10-16 Thread Duncan Booth
Alex Strickland 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

Re: portable unicode literals

2012-10-15 Thread Serhiy Storchaka
On 15.10.12 16:05, Ulrich Eckhardt wrote: I need a little nudge in the right direction, as I'm misunderstanding something concerning string literals in Python 2 and 3. In Python 2.7, b'' and '' are byte strings, while u'' is a unicode literal. In Python 3.2, b'' is a byte string and '' is a unico

Re: portable unicode literals

2012-10-15 Thread Alex Strickland
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 vers

Re: portable unicode literals

2012-10-15 Thread Dave Angel
On 10/15/2012 09:05 AM, Ulrich Eckhardt wrote: > Hi! > > I need a little nudge in the right direction, as I'm misunderstanding > something concerning string literals in Python 2 and 3. In Python 2.7, > b'' and '' are byte strings, while u'' is a unicode literal. In Python > 3.2, b'' is a byte strin

Re: portable unicode literals

2012-10-15 Thread Steven D'Aprano
On Mon, 15 Oct 2012 15:05:01 +0200, Ulrich Eckhardt wrote: > Hi! > > I need a little nudge in the right direction, as I'm misunderstanding > something concerning string literals in Python 2 and 3. In Python 2.7, > b'' and '' are byte strings, while u'' is a unicode literal. In Python > 3.2, b'' i

portable unicode literals

2012-10-15 Thread Ulrich Eckhardt
Hi! I need a little nudge in the right direction, as I'm misunderstanding something concerning string literals in Python 2 and 3. In Python 2.7, b'' and '' are byte strings, while u'' is a unicode literal. In Python 3.2, b'' is a byte string and '' is a unicode literal, while u'' is a syntax