Decide the fate of undocumented script behavior of some modules
未关闭
还没有人认领这个 Issue。
docs
tests
type-feature
- 主要语言
- Python
- 星标
- 77.2k
- 派生
- 36k
- PR 合并指标
- PR 指标待抓取
描述
There are three dozens of standard modules that can be called via python -m and their documentation doesn't mention it. They can be grouped into five categories:
-
kind of smoke tests:
- codecs:
performs stdin:latin1 → utf-8 → latin1 → stdout passthroughedit: it just wraps stdin and stdout then just exits the script (gh-94233) - curses.has_key: "Compare the output of this implementation and the ncurses has_key, on platforms where has_key is already available"
- pprint: measures performance (gh-94613 → https://github.com/python/pyperformance/pull/222)
- random: evaluates output statistics of supported generators
- codecs:
-
full-fledged crossplatform utils for admin-like users and small automation:
- asyncio: like
pythonbut allows to useawaitin top-level script code - cProfile, profile: runs a script under the profiler
- encodings.rot_13: a stream converter
- filecmp: a crossplatform file comparison utility
- fileinput: prints specified files one by another annotating lines with their source
- http.server: makes a directory available as a site; useful to quickly test a static site with relative links
- mimetypes: useful for batch processing of files (maybe) (gh-93097)
- modulefinder: the objdump but for Python source files
- netrc: prints content of
.netrcfor a current user - pdb
- platform: returns a single line like
Windows-10-10.0.19044-SP0; can be useful in automation - quopri: a stream converter
- tabnanny
- wsgiref.simple_server - the same as http.server but for APIs; pases a single request and exits
- asyncio: like
-
both:
- base64:
- a stream converter
-
base64 -tencodes/decodesAladdin:open sesameand tests if the result is the same as the original (gh-94230)
- base64:
-
demos with no real world application:
- curses.textpad: shows an input area; when a user closes it, prints the text back
- ftplib: a simple one-pass FTP downloader (uses ~/.netrc for login)
-
getopt: just passes arguments toThe module is no longer maintained after gh-105735getopt() - imaplib: sending emails to a dead end has no sence but can be used to check if a email client works or got broken
- shlex: parses stdin using
shlex()and prints the list into stdout - smtplib: a simple e-mail client
- xmlrpc.server: serves a datetime service
-
complex matter; better leave untouched:
- idlelib.*
- tkinter.*
- turtledemo.*
- pstats
Eggs and to-be-removed modules aren't listed.
We need to decide what to do with all these undocumented categories.
I propose the following:
- move smoke tests into
testmodule with deduplication - for full-fledged utils, add
Command-Line Usageinto the docs like in https://docs.python.org/3/library/ast.html#command-line-usage or https://docs.python.org/3/library/trace.html#command-line-usage - move demos into the docs of the corresponding module
Linked PRs
- gh-131039
- gh-131068
- gh-131069
- gh-131080
- gh-131081
- gh-131097
- gh-131099
- gh-131130
- gh-131133
- gh-131136
- gh-131137
- gh-131144
- gh-131273
- gh-131408
- gh-132266
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先检查列出的模块类别,以及 ast 和 trace 文档中现有的“Command-Line Usage”部分。查看链接的 PR,了解哪些项目已经在处理中,然后确定每个剩余行为应归入测试模块还是相应模块的文档。完成的标准是:已决定每个列出类别的处理方式,并记录由此产生的文档或测试更改。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- cli, documentation
- Issue 类型
- 文档
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 15/100