|
|
|
List comprehension grammar is defined that way to allow "[ k+v for (k, v) in d.items() ]", for example.
Seo Sanghyeon |
06/04/22 - 10:40 pm | #
|
|
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.
Fuzzyman |
Homepage |
06/04/23 - 12:36 am | #
|
|
http://www.w3.org/1999/02/26-mod...les/User/
Yacker
http://www.w3.org/2005/01/yacker
Might be interesting for you
karl |
Homepage |
06/04/29 - 7:19 am | #
|
|
|
Commenting by HaloScan
|