Docstring of array.array misses 'w' type info and mentions wide/narrow builds
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Documentation
The docstring of array.array at https://github.com/python/cpython/blob/cfcd52490d6531f3b0e8ddd4bb2b40fb6baee854/Modules/arraymodule.c#L2912 has a few mistakes:
- in description of 'u' type it mentions the narrow/wide build split that is not a thing since 3.3 - https://docs.python.org/3/whatsnew/3.3.html#functionality
- it doesn't mention that since 3.3 the 'u' type is deprecated and 'w' should be used.
- it doesn't mention that 'u' type since 3.9 corresponds to
wchar_tof C compiler used (so usually 2 byte UTF-16 on Windows, 4 byte UTF-32 elsewhere), instead of to narrow/wide Python build. - it doesn't mention the newer 'w' type that is Python's own
Py_UCS44 byte UTF-32.
The documentation at https://docs.python.org/3/library/array.html doesn't have these issues, only the docstring (that is shown in help(array.array) in the REPL) does. This is a mismatch between documentation and docstring.
Linked PRs
- gh-142323
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 in Modules/arraymodule.c around the array.array docstring referenced by the issue, then compare it with the array documentation at docs.python.org/3/library/array.html. Done means the docstring covers the current 'u' and 'w' type information without the obsolete narrow/wide build wording; check linked PR gh-142323 before starting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 30/100