Skip to content

Item deletion support for bytearray object #10221

@AmirHmZz

Description

@AmirHmZz

Is there any reason that list supports item deletion but bytearray doesn't?

# list example
>>> ls = [1, 2, 3, 4]
>>> del ls[-2:]
>>> ls
[1, 2]

# bytearray example
>>> barr = bytearray(b"1234")
>>> del barr[-2:]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'bytearray' object doesn't support item deletion

CPython already supports item deletion for bytearray. I've also searched MicroPython differences from CPython but I didn't find anything about this one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature requests, new feature implementationspy-coreRelates to py/ directory in source

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions