Message90136
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. |
|
Date |
User |
Action |
Args |
2009-07-04 23:37:41 | alexandre.vassalotti | set | recipients:
+ alexandre.vassalotti, loewis, exarkun, QuantumTim, benjamin.peterson, hotdog003 |
2009-07-04 23:37:41 | alexandre.vassalotti | set | messageid: <1246750661.33.0.613321389135.issue6410@psf.upfronthosting.co.za> |
2009-07-04 23:37:39 | alexandre.vassalotti | link | issue6410 messages |
2009-07-04 23:37:39 | alexandre.vassalotti | create | |
|