A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2017-November/150502.html below:

[Python-Dev] Disallow ambiguous syntax f(x for x in [1],)

[Python-Dev] Disallow ambiguous syntax f(x for x in [1],)Serhiy Storchaka storchaka at gmail.com
Mon Nov 13 02:22:11 EST 2017
13.11.17 02:00, Guido van Rossum пише:
> It's hard to keep those two in sync, since the actual Grammar file is 
> constrained by being strictly LL(1)... Can you get someone else to 
> review the implementation?

I haven't change the grammar, just have changed checks in the CST to AST 
transformer. Maybe it would be better to change the grammar, but I'm not 
expert in this. Maybe Benjamin could provide better solution.

There are other related differences between language specification and 
the implementation. The following examples are valid syntax:

     @deco(x for x in [1])
     def f(): ...

     class C(x for x in [1]): ...

The latter always raises a TypeError at runtime ("cannot create 
'generator' instances"), but is compiled successfully.

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4