Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add array.clear() #114894

Closed
mikeziminio opened this issue Feb 2, 2024 · 1 comment
Closed

Add array.clear() #114894

mikeziminio opened this issue Feb 2, 2024 · 1 comment
Labels
type-feature A feature request or enhancement

Comments

@mikeziminio
Copy link
Contributor

mikeziminio commented Feb 2, 2024

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

@mikeziminio mikeziminio added the type-bug An unexpected behavior, bug, or error label Feb 2, 2024
mikeziminio added a commit to mikeziminio/cpython that referenced this issue Feb 2, 2024
@JelleZijlstra JelleZijlstra added type-feature A feature request or enhancement and removed type-bug An unexpected behavior, bug, or error labels Feb 3, 2024
@JelleZijlstra JelleZijlstra changed the title We need to implement array.clear() Add array.clear() Feb 3, 2024
JelleZijlstra added a commit that referenced this issue Feb 10, 2024
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@JelleZijlstra
Copy link
Member

Thanks for your contribution!

fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this issue Feb 14, 2024
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants