Re: Unicode raw string containing \u

2007-10-28 Thread Martin v. Löwis
> That doesn't answer my question, since I asked for a unicode RAW > string literal. Is this not possible? (I was able to get what I want > using ur"\u005Cuniverse", although this is not totally ideal.) It's a design flaw in Unicode raw string literals that they still interpret \u escape

Re: Unicode raw string containing \u

2007-10-28 Thread OKB (not okblacke)
Steven D'Aprano wrote: >> How can I specify a unicode raw string literal that >> contains a >> single backslash followed by the word "universe"? > > The usual way. > word = u'\\universe' len(word) 9 word[0] u'\\' word[1] u'u' print word \universe word u'\\univer

Re: Unicode raw string containing \u

2007-10-28 Thread Steven D'Aprano
On Sun, 28 Oct 2007 06:58:48 +, OKB (not okblacke) wrote: > I'm trying to write a unicode raw string literal, and I seem to be > running up against a conflict between the \u unicode character > escape and the need to have a literal \u (i.e., backslash followed by a > lowercase letter U) in

Unicode raw string containing \u

2007-10-28 Thread OKB (not okblacke)
I'm trying to write a unicode raw string literal, and I seem to be running up against a conflict between the \u unicode character escape and the need to have a literal \u (i.e., backslash followed by a lowercase letter U) in the string. If I do ur"\universe" I get a UnicodeD