A simple single line, triple-quoted comment is giving syntax error. Why?

Thomas 'PointedEars' Lahn PointedEars at web.de
Thu Mar 26 00:35:46 EDT 2015


Chris Angelico wrote:

> On Sun, Mar 22, 2015 at 2:49 PM, Thomas 'PointedEars' Lahn
> <PointedEars at web.de> wrote:
>>> Implicit concatenation is part of the syntax, not part of the expression
>>> evaluator.
>> Reads like nonsense to me.
> 
> What do you mean?

As I showed, string literals and consecutive tokens of string literals 
(“STRING+”) so as to do implicit concatenation *are* expressions of the 
Python grammar.  Expressions are *part of* the syntax of a programming 
language.

Perhaps you mean that the time when implicit concatenation is evaluated 
(compile time) differs from the time when other expressions are evaluated 
(runtime).  But a) whether that is true depends on the implementation and
b) there can be no doubt that either expression needs to be evaluated.  So 
whatever you mean by “expression evaluator” has to be able to do those 
things.

Which makes the statement above read like nonsense to me.

-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.



More information about the Python-list mailing list