PEP 802: Display Syntax for the Empty Set

Haha, yeah I can see that, note this proposal only applies to right hand side contexts. Maybe best way to think about it is in a repl with *().

My proposal would work same way using that which works today, but shortened to “*” compiled out of the resulting AST and possibly limited to first literal element position.

But maybe the compiler should have a special case which compiles out the *() idiom starred node inside literal containers completely, then get all the benefits without meaningfully changing language (but doubt anyone would learn this if not official syntax).

Edit: Have put up a issue/PR that optimizes the {*()} idiom regardless of any decision on this PEP or other related proposals. Very early on @AA-Turner had mentioned this optimization.

2 Likes