[Python-ideas] Unpack of sequences

Guido van Rossum guido at python.org
Wed Aug 29 22:45:19 CEST 2012

On Wed, Aug 29, 2012 at 1:43 PM, Masklinn <masklinn at masklinn.net> wrote:
> 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.

But {a, b, c} doesn't look like a dict.

Please give it up.

--Guido van Rossum (python.org/~guido)

More information about the Python-ideas mailing list