On Thu, Mar 15, 2018 at 10:21:24AM +0100, Thomas Jollans wrote:
> On 2018-03-15 07:11, Ben Finney wrote:
> > Steven D'Aprano writes:
> >
> >> py> """\""
[...]
> Then riddle me this:
>
> if """\"" is equivalent to "" + "\"" + "" + "", then why isn't
> """ \""" """ equivalent to "" + " \""
Thomas Jollans writes:
> Then riddle me this:
>
> if """\"" is equivalent to "" + "\"" + "" + "", then why isn't
> """ \""" """ equivalent to "" + " \"" + " " + ""?
Who can say? I was only asked for an explanation, not a consistent one
:-)
Perhaps it's a micro-optimisation, to create more e
On 2018-03-15 07:11, Ben Finney wrote:
> Steven D'Aprano 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.
>
Steven D'Aprano 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 ‘+’
explicit is better than implicit.
That gives me an idea for a module with the following debugging command line
functionality.
import sass
>>> "" ":p"
Traceback:
Are you telling me that ' ' is supposed to an operator? (Rock thrown)
On March 14, 2018 10:40:38 AM GMT+01:00, Thomas Jollans wr
On 2018-03-14 05:08, Steven D'Aprano wrote:
> Explain the difference between these two triple-quoted strings:
>
> Here is a triple-quoted string containing spaces and a triple-quote:
>
> py> """ \""" """
> ' """ '
>
>
> But remove the spaces, and two of the quotation marks disappear:
>
> py> "
Dan Sommers wrote:
On Wed, 14 Mar 2018 04:08:30 +, Steven D'Aprano wrote:
Explain the difference between these two triple-quoted strings:
But remove the spaces, and two of the quotation marks disappear:
py> """\""
'"'
That's (a) a triple quoted string containing a single escaped q
On 14Mar2018 04:08, Steven D'Aprano
wrote:
Explain the difference between these two triple-quoted strings:
Here is a triple-quoted string containing spaces and a triple-quote:
py> """ \""" """
' """ '
But remove the spaces, and two of the quotation marks disappear:
py> """\""
'"'
"""
On Wed, 14 Mar 2018 04:08:30 +, Steven D'Aprano wrote:
> Explain the difference between these two triple-quoted strings:
> But remove the spaces, and two of the quotation marks disappear:
>
> py> """\""
> '"'
That's (a) a triple quoted string containing a single escaped quote,
followed