Andrew Barnert added the comment:
> It seems no more interesting or problematic than sequence argument unpacking
> working with dictionaries, "a, b = {'one': 1, 'two': 2}".
Dictionaries (including dicts, dict subclasses, and custom Mappings) are
iterables. People use that fact every time they write `for key in d`. So it's
not at all problematic that they work with iterable unpacking. Especially since
here, custom Mappings work exactly the same way as dicts, dict subclasses,
custom Sets, iterators, and every other kind of iterable.
Dictionaries are not sequences. People never write code expecting them to be.
So it is problematic that they work with sequence reversing. Especially since
here, custom Mappings do _not_ work the same way as dicts, dict subclasses,
custom Sets, iterators, and other non-sequences, all of which raise a TypeError.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue25864>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com