[docs] [issue12631] Mutable Sequence Type in .remove() is consistent only with lists, but not with bytearrays

py.user report at bugs.python.org
Mon Jul 25 02:26:30 CEST 2011


New submission from py.user <port139 at yandex.ru>:

4.6.4 Mutable Sequence Types

|  s.remove(x)  |  same as del s[s.index(x)]  |


>>> b = bytearray()
>>> b.extend(range(1, 6))
>>> b
bytearray(b'\x01\x02\x03\x04\x05')
>>> b.remove(2)
>>> del b[b.index(2)]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Type int doesn't support the buffer API
>>>

----------
assignee: docs at python
components: Documentation, Interpreter Core
messages: 141066
nosy: docs at python, py.user
priority: normal
severity: normal
status: open
title: Mutable Sequence Type in .remove() is consistent only with lists, but not with bytearrays
versions: Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12631>
_______________________________________


More information about the docs mailing list