Alexandre Vassalotti <[email protected]> added the comment:
Tim Gordon wrote:
> __add__ is non-commutative for lists, tuples, strings etc. - perhaps
> non-commutative wasn't quite what you were looking for :p.
Yeah, I was not clear in my explanation.
The thing is for lists, tuples, string and other ordered types
concatenation is a well-defined concept. Whereas for dictionaries is not
obvious what concatenation should do with duplicate keys. For example,
what would be the result of {"a": 1, "b": 2} + {"a": 2, "b": 1}? Should
it be {"a": 1, "b": 2} or {"a": 2, "b": 1}?
Also, it would be inconsistent the use of | for the union operation of sets.
----------
status: closed -> open
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue6410>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com