Issue 6037: MutableSequence.iadd should return self (original) (raw)

I've implemented a LinkedList as a MutableSequence and iadd, which is inherited from MutableSequence, does not perform as expected. The _abcoll.py file contains this:

class MutableSequence(Sequence): ... def iadd(self, values): self.extend(values)

The method iadd does not return anything, buy it should return self. Right now, the sentence

aLinkedList += [1, 2]

sets the value of aLinkedList to None.

I've implemented a LinkedList as a MutableSequence and iadd, which is inherited from MutableSequence, does not perform as expected. The _abcoll.py file contains this:

class MutableSequence(Sequence): ... def iadd(self, values): self.extend(values)

The method iadd does not return anything, buy it should return self. Right now, the sentence

aLinkedList += [1, 2]

sets the value of aLinkedList to None.