python / python/cpython

Decide the fate of undocumented script behavior of some modules

未關閉
#93,096 9 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 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 passthrough edit: 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
  • full-fledged crossplatform utils for admin-like users and small automation:

    • asyncio: like python but allows to use await in 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 .netrc for 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
  • both:

    • base64:
      • a stream converter
      • base64 -t encodes/decodes Aladdin:open sesame and tests if the result is the same as the original (gh-94230)
  • 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 to getopt() The module is no longer maintained after gh-105735
    • 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:

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

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先檢查列出的模組類別,以及 ast 和 trace 文件中現有的「Command-Line Usage」區段。查看連結的 PR,了解哪些項目已在處理中,然後判斷每個剩餘行為應歸入測試模組還是對應模組的文件。完成的標準是:已決定每個列出類別的處理方式,並記錄由此產生的文件或測試變更。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
cli, documentation
Issue 類型
文件
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
需要釐清
新手友好度
15/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。