This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Mutable Sequence Type in .remove() is consistent only with lists, but not with bytearrays
Type: behavior Stage:
Components: Documentation, Interpreter Core Versions: Python 3.1
Status: closed Resolution:
Dependencies: Superseder: index() and count() methods of bytes and bytearray should accept byte ints
View: 12170
Assigned To: docs@python Nosy List: docs@python, petri.lehtinen, py.user
Priority: normal Keywords:

Created on 2011-07-25 00:26 by py.user, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg141066 - (view) Author: py.user (py.user) * Date: 2011-07-25 00:26
4.6.4 Mutable Sequence Types

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

>>> b = bytearray()
>>> b.extend(range(1, 6))
>>> b
>>> 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
msg141218 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2011-07-27 10:45
Duplicate of issue 12170.
Date User Action Args
2022-04-11 14:57:20adminsetgithub: 56840
2011-08-01 06:46:31petri.lehtinensetstatus: open -> closed
2011-07-27 10:45:14petri.lehtinensetsuperseder: index() and count() methods of bytes and bytearray should accept byte ints

messages: + msg141218
nosy: + petri.lehtinen
2011-07-25 00:26:57py.usersettype: behavior
2011-07-25 00:26:29py.usercreate