raw strings

Terry Reedy tjreedy at udel.edu
Tue Oct 8 19:04:23 EDT 2002


"Michele Simionato" <mis6 at pitt.edu> wrote in message
news:2259b0e2.0210081328.2c749ab7 at posting.google.com...
> Is there a function which converts a string in a raw string ?

No.  Strictly speaking, there is no such thing as a raw string to
convert to.  There are normal string literals and raw strings literals
and both get converted to Python string objects.  The only difference
is in how \ is interpreted during the conversion process.  The 'raw'
alternative was added a couple of years ago to simplify the writing of
string literals that would give string values containing \ after the
conversion.  This is mostly used for writing regular expressions.

Terry J. Reedy







More information about the Python-list mailing list