what is wrong with that r"\"

i3dmaster i3dmaster at gmail.com
Fri Jul 6 12:45:54 EDT 2007


Then you can use other chars as the delimiter, r at a@b@ or r!a!b!,  
etc... The import thing is so long as the interpreter doesn't get  
confused on the data and the delimiter.  sed also allows for  
arbitrary delimiters too as long as you maintain the integrity of the  
original meaning...

-Jim

On Jul 6, 2007, at 5:20 AM, Tim Roberts wrote:

> Matthieu TC <matthieutc at yahoo.com> wrote:
>
>> May I suggest giving the possibility to use any delimiter for a  
>> raw string?  just like in Vi or ruby.
>>
>> Vi:
>> %s_a_b_g  is valid and so is  %s/a/b/g
>>
>> Ruby:
>> %q{dj'\ks'a\'"}   or %q-dj'\ks'a\'"-
>>
>> So as long as your regex does not use all the valid characters,  
>> readability is maintained.
>
> But what about my program that wants to use r_a_b_ as an identifier?
> -- 
> Tim Roberts, timr at probo.com
> Providenza & Boekelheide, Inc.
> -- 
> http://mail.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list