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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy