'array.array' has no attribute 'clear'
Open
Nobody has claimed this yet.
stubs: false negative
- Dominant language
- Python
- Stars
- 5.1k
- Forks
- 2.1k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 82
Description
array.array inheriting from MutableSequence has some unintended consequences, such as below
import array
x = array.array("B")
x.clear()
At runtime array.array does not have .clear(). Is it meant to have a .clear() implemented? Right now at least it doesn't and the stubs give an incorrect definition.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the typeshed stub for array.array and compare its inherited MutableSequence methods with the runtime behavior shown in the issue. Check whether array.array is expected to provide clear(); done means the stub accurately reflects the runtime, with the issue's question about adding the method resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100