[Python-3000] Raw strings containing \u or \U

Ron Adam rrr at ronadam.com
Wed May 16 23:05:57 CEST 2007


Guido van Rossum wrote:
> That would be great! This will automatically turn \u1234 into 6
> characters, right?

I'm not exactly clear when the '\uxxxx' characters get converted.  There 
isn't any conversion done in tokanize.c that I can see.  It's primarily 
only concerned with finding the beginning and ending of the string at that 
point.  It looks like everything between the beginning and end is just 
passed along "as is" and it's translated further later in the chain.

(I had said earlier tokanize.py,  meant tokanize.c)


> Perhaps you could make the patch against the py3k-struni branch
> instead of against the regular p3yk (sic) branch?

I can do that.  :-)



> On 5/16/07, Ron Adam <rrr at ronadam.com> wrote:
>> Steven Bethard wrote:
>>
>> > I actually wasn't able to find something I couldn't translate.  It
>> > would be helpful to have another set of eyes if anyone has the time.
>>
>> I have a patch against (*) 2.6 tokanize.py that ignores '\' characters in
>> raw strings.  This has two effects.  A matching quote, """, ''', ", ', of
>> the type that started the string closes the string even if it is preceded
>> by a back slash, and a back slash can end a raw string.  No changes to
>> regular string behavior was made.
>>
>> I'll try to make a patch against the python 3000 branch and uploaded 
>> so it
>> can be used for testing.  (Unless of course someone else has already 
>> did it.)
>>
>> Ron
>>
>>
>> * I didn't have the python 3000 branch on my computer at the time.
>> _______________________________________________
>> Python-3000 mailing list
>> Python-3000 at python.org
>> http://mail.python.org/mailman/listinfo/python-3000
>> Unsubscribe: 
>> http://mail.python.org/mailman/options/python-3000/guido%40python.org
>>
> 
> 



More information about the Python-3000 mailing list