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:
-
full-fledged crossplatform utils for admin-like users and small automation:
-
both:
-
demos with no real world application:
-
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
There are three dozens of standard modules that can be called via
python -mand their documentation doesn't mention it. They can be grouped into five categories:kind of smoke tests:
performs stdin:latin1 → utf-8 → latin1 → stdout passthroughedit: it just wraps stdin and stdout then just exits the script (gh-93096: Removepython -m codecs#94233)python -m pprintpyperformance#222)full-fledged crossplatform utils for admin-like users and small automation:
pythonbut allows to useawaitin top-level script codemimetypesCLI tool public #93097).netrcfor a current userWindows-10-10.0.19044-SP0; can be useful in automationboth:
base64 -tencodes/decodesAladdin:open sesameand tests if the result is the same as the original (gh-93096: Removepython -m base64 -t#94230)demos with no real world application:
getopt: just passes arguments toThe module is no longer maintained after gh-106535: Soft deprecate the getopt module #105735getopt()shlex()and prints the list into stdoutcomplex matter; better leave untouched:
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:
testmodule with deduplicationCommand-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-usageLinked PRs
-tand-vflags frompickletoolscli #131039-tand-vflags frompicklecli #131068test_pickle#131069test_pickle(GH-131069) #131080test_pickle(GH-131069) #131081pickleCLI #131097difflib#131099heapq#131130test_itertools#131133test_itertools(GH-131133) #131136test_itertools(GH-131133) #131137randombenchmark into pyperformance #131144pickletoolsCLI #131273test_mimetypes.test_guess_type_conflicting_with_mimetypes#131408test_mimetypes.test_invocation_errortests on iOS ARM64 #132266