orderedmultidict
orderedmultidict copied to clipboard
Binary operators
added __add__ and __iadd__
__add__() and __iadd__() should use c.add(k, value=v) over c.set(k, value=v).
When I see this code
>>> omdict([(1, 'a')]) + omdict([(1, 'a')])
>>> [result]
I expect [result] to be
omdict([(1, 'a'), (1, 'a')])
not
omdict([(1, 'a')])
c.add(k, value=v) results in the former.
Do you expect omdict([(1, 'a')]) + [(1, 'a')] to yield omdict([(1, 'a')])?
That's fair it doesn't really make sense like this, what symbol should set have? Just use | or another one?