The Voidspace Techie Blog

Gravatar List comprehension grammar is defined that way to allow "[ k+v for (k, v) in d.items() ]", for example.


Gravatar Sure - but the ``expression_list`` in the part of the definition I showed, only applies to the ``(k, v)`` part of your list comprehension.

That part can only take identifiers (although nested however you please), *not* expressions.

It happens to parse as an expression, but the grammar leaves more work to be done by the compiler.


Gravatar http://www.w3.org/1999/02/26-mod...les/User/ Yacker

http://www.w3.org/2005/01/yacker

Might be interesting for you


Name:

Email:

URL:

Comment:  ? 

 

Commenting by HaloScan