[Python-Dev] \u and \U escapes in raw unicode string literals (original) (raw)
"Martin v. Löwis" martin at v.loewis.de
Sat May 12 00:48:00 CEST 2007
- Previous message: [Python-Dev] \u and \U escapes in raw unicode string literals
- Next message: [Python-Dev] \u and \U escapes in raw unicode string literals
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Using double backslashes won't cause that reaction:
os.stat("c:\windows\system32\user32.dll")
Please refer to the subject. We are talking about raw strings.
Windows path names are one of the two primary applications of raw strings (the other being regexes). IMHO the primary use case are regexps
It's not a matter of opinion. It's a statistical fact that these are the two cases where people use raw strings most.
and for those you'd definitely want to be able to put Unicode characters into your expressions.
For regular expressions, you don't need them as part of the string literal syntax: The re parser itself could support \u, just like it supports \x today.
BTW, if you use ur"..." for your expressions today (which you should if you parse text), then nothing will change when removing the 'u' prefix in Py3k.
How do you know? Py3k hasn't been released, yet.
Regards, Martin
- Previous message: [Python-Dev] \u and \U escapes in raw unicode string literals
- Next message: [Python-Dev] \u and \U escapes in raw unicode string literals
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]