[Python-ideas] Unpack of sequences

Masklinn masklinn at masklinn.net
Wed Aug 29 22:43:43 CEST 2012


On 2012-08-29, at 20:21 , Guido van Rossum wrote:
> 
> But {a, b, c} is already a set.

On the rhs, the lhs is expected to have different semantics: (a, b, c) =
… matches any 3-items iterable (including sets), not necessarily a
tuple. If there really is a need for disambiguation, colons could be added
after the keys ({a:, b:, c:}), but I don't think the original syntax
is confusing (let alone enough to warrant this).

After all, {} is for dictionaries before it's for sets, I'm guessing
most Python users still associate braces with dictionaries more than
with sets.


More information about the Python-ideas mailing list