what is wrong with that r"\"

Tim Roberts timr at probo.com
Sat Jul 7 21:48:09 EDT 2007


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.



More information about the Python-list mailing list