On 2018-03-15 07:11, Ben Finney wrote:
> Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> writes:
> 
>> py> """\""""""
>> '"'
> 
> That's an empty string delimited by ‘"’; followed by a double-quote
> character, escaped, delimited by ‘"’; followed by two more empty
> strings. They concatenate to a single one-character string.
> 
> Equivalent to
> 
>     "" + "\"" + "" + ""
> 
> without the ‘+’ operations.
> 
>> If nobody gets the answer, I shall reveal all later.
> 
> My interpretation may not be how the language defines it; but it does
> match the result!
> 

Then riddle me this:

if """\"""""" is equivalent to "" + "\"" + "" + "", then why isn't
""" \""" """ equivalent to "" + " \"" + " " + ""?

As I said earlier: I initially thought the way you're thinking, but got
stuck at that question and had to back-track my reasoning :-)

T

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to