what is wrong with that r"\"

jimxu jimxu at google.com
Sun Jul 8 04:55:09 EDT 2007


Yeah, that's a good point...


On Jul 8, 2007, at 1:48 AM, Tim Roberts wrote:

> i3dmaster <i3dmaster at gmail.com> wrote:
>>
>> 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.
>
> That limits the number of valid delimiters to a relatively small  
> set.  You
> couldn't use any valid operator:
>
>    x = r*a*b
>
> Is that a one character raw string appended to a string called "b",  
> or is
> that to multiplications?
>
>> sed also allows for
>> arbitrary delimiters too as long as you maintain the integrity of the
>> original meaning...
>
> sed can do that because its commands are one character long.  Whatever
> follows an "s" must a delimiter because it can't be anything else.
> -- 
> 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