[Python-Dev] Any grammar experts?

Georg Brandl g.brandl at gmx.net
Sun Jan 25 16:32:01 CET 2015


On 01/25/2015 04:08 PM, Antoine Pitrou wrote:
> On Sat, 24 Jan 2015 21:10:51 -0500
> Neil Girdhar <mistersheik at gmail.com> wrote:
>> To finish PEP 448, I need to update the grammar for syntax such as
>> 
>> {**x for x in it}
> 
> Is this seriously allowed by the PEP? What does it mean exactly?

It appears to go a bit far.  Especially since you also would have to allow

{*x for x in it}

which is a set comprehension, while the other is a dict comprehension :)

Georg



More information about the Python-Dev mailing list