Docstring of array.array misses 'w' type info and mentions wide/narrow builds
未关闭
还没有人认领这个 Issue。
docs
- 主要语言
- Python
- 星标
- 77.2k
- 派生
- 35.9k
- PR 合并指标
- PR 指标待抓取
描述
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
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
先从 Modules/arraymodule.c 中 issue 所引用的 array.array docstring 附近开始,然后将其与 docs.python.org/3/library/array.html 中的 array 文档进行比较。完成的标准是:docstring 涵盖当前的 'u' 和 'w' 类型信息,并且不再使用关于 narrow/wide build 的过时表述;开始前检查已链接的 PR gh-142323。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- c, python
- 领域
- documentation
- Issue 类型
- 文档
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 30/100