On Mon, Apr 25, 2016 at 2:04 AM, Ethan Furman <et...@stoneleaf.us> wrote:
> Unfortunately, the empty tuple tends to be a singleton, so there is no way
> to tell that red and default are (supposed to be) the same and blue is
> (supposed to be) different:
>
> --> a = b = ()
> --> c = ()
> --> a is b
> True
> --> a is c
> True
>
> If you have an idea on how to make that work I am interested.

Easy: allow an empty list to have the same meaning as an empty tuple.
Every time you have [] in your source code, you're guaranteed to get a
new (unique) empty list, and then multiple assignment will work.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to