New submission from Andrés Marzal <amar...@lsi.uji.es>:

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.

----------
components: Library (Lib)
messages: 87872
nosy: amarzal
severity: normal
status: open
title: MutableSequence.__iadd__ should return self
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue6037>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to