Skip to content

Add array.clear() #114894

Closed
Closed

Description

@mikeziminio

Bug report

Bug description:

from array import array

x = array("B")
x.clear()    # AttributeError: 'array.array' object has no attribute 'clear'

But array is a MutableSequence, so we expect the clear() method to be implemented.
If this is correct, then I'm ready to work on PR.

Original issue from the typeshed repository: python/typeshed#11008

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Activity

  1. added a commit that references this issue on Feb 2, 2024
  2. added
    type-featureA feature request or enhancement
    and removed
    type-bugAn unexpected behavior, bug, or error
    on Feb 3, 2024
  3. changed the title [-]We need to implement array.clear()[/-] [+]Add array.clear()[/+] on Feb 3, 2024
  4. added a commit that references this issue on Feb 10, 2024
  5. JelleZijlstra commented on Feb 10, 2024

    @JelleZijlstra
    Member

    Thanks for your contribution!

  6. added a commit that references this issue on Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions