r"string" vs R"string

Aahz aahz at pythoncraft.com
Sun Jan 17 11:17:34 EST 2010


In article <hiv4c6$5l8$1 at theodyn.ncf.ca>,
Colin W. <cjwilliams43 at gmail.com> wrote:
>On 17-Jan-10 02:16 AM, Terry Reedy wrote:
>> On 1/17/2010 1:55 AM, Brendan Miller wrote:
>>>
>>> Is there any difference whatsoever between a raw string beginning with
>>> the captical R or one with the lower case r e.g. r"string" vs
>>> R"string"?
>>
>> No. Nor is there and difference between the strings created with raw
>> literals and cooked literals.
>
>"cooked" literal  ??

Consider '\n' vs r'\n' -- the first version is "cooked" (as cooking
alters the ingredients) to produce the newline character.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"If you think it's expensive to hire a professional to do the job, wait
until you hire an amateur."  --Red Adair



More information about the Python-list mailing list