cpython/Modules
Stephen Rosen 50fe49c879
gh-150319: Replace all documentation which says "See PEP 585" (#150325)
* Replace all documentation which says "See PEP 585"

The following classes in the stdlib get simple updates:

- array.array
- asyncio.Future
- asyncio.Task
- collections.defaultdict
- collections.deque
- contextvars.ContextVar
- contextvars.Token
- ctypes.Array
- os.DirEntry
- re.Match
- re.Pattern
- string.templatelib.Interpolation
- string.templatelib.Template
- types.MappingProxyType
- queue.SimpleQueue
- weakref.ref

The following classes are documented publicly as functions, and are
therefore updated internally (`__class_getitem__.__doc__`) but not in the
public docs:

- functools.partial
- itertools.chain

The following builtin types have updates to `__class_getitem__.__doc__`
but not to any documentation pages:

- BaseExceptionGroup
- coroutines (from generators)
- dict
- enumerate
- frozendict
- frozenset
- generators (and async generators)
- list
- memoryview
- set
- slice
- tuple

Special cases:

- union objects are now documented as "supporting class-level []",
  rather than anything to do with generics.

- Templates might be generic over a single type (union, in theory) or
  over a TypeVarTuple. As this is not currently fully settled, it is
  marked with a comment and a mild hint that it is a single type is used
  (namely, "type" is singular rather than "types", plural)

* Apply suggestions from code review

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>

* Correct several class getitem docs

And expand the text for tuples.

Co-authored-by: Jelle Zijlstra <906600+JelleZijlstra@users.noreply.github.com>

* Add notes on generic typing of builtins

* Fix typo in tuple.__class_getitem__ docstring

* Typo fix: malformed refs

Fix `generic` links which weren't marked as `:ref:`.

* Strike unnecessary docs on generic-ness

Co-authored-by: Jelle Zijlstra <906600+JelleZijlstra@users.noreply.github.com>

* Apply suggestions from code review

These are applied at both the originally indicated locations and in the
corresponding docstring definitions.

Co-authored-by: Alex Waygood <66076021+AlexWaygood@users.noreply.github.com>

* Update Doc/library/re.rst

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Update Objects/enumobject.c

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>

* Remove tuple generic doc in 'stdtypes' page

This is covered in more detail in the cross-linked typing documentation.
The other copy of this documentation -- in the docstring for
`tuple.__class_getitem__` -- is left in place.

* Fix whitespace around new doc of generics

Per review, do not introduce or remove whitespace such that section
breaks are altered by the introduction of doc on various generic types.

In most cases, this is a removal of an extra line.

In one case (Arrays), it is the reintroduction of a line.

Additionally, two other minor fixes are included:
- incorrect indent on 'defaultdicts'
- make `mappingproxy.__class_getitem__.__doc__` consistent with other
  mapping type generic docs

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Move placement of memoryview generic note

Previous placement was at the end of the main docstring, which is
consistent with other types but places it after a section on various
methods (which makes it read somewhat inconsistently). Moving it up
helps resolve.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Ensure sphinxdoc does not start sentences lowercase

Lowercase class names at the start of sentences are marked out with the
`class` role. In the case of `deque`, documentation already refers to
these as `Deques`, so this form is preferred.

* Apply suggestions from code review

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>

* Fix line endings and wrap more tightly

Line endings fixed by pre-commit ; also re-wrapped the MappingProxyType
text which was too long.

* Use 'ContextVars' style in sphinx doc

---------

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <906600+JelleZijlstra@users.noreply.github.com>
Co-authored-by: Alex Waygood <66076021+AlexWaygood@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-06-02 21:13:34 +01:00
..
_ctypes gh-150319: Replace all documentation which says "See PEP 585" (#150325) 2026-06-02 21:13:34 +01:00
_decimal gh-115119: Remove superfluous TEST_COVERAGE private macro from _decimal module (GH-149756) 2026-06-01 13:41:21 -05:00
_hacl gh-148200: Update Modules/_hacl/ for Cygwin (#149802) 2026-05-15 14:42:30 +02:00
_io gh-149046: fix: correctly handle str subclasses in io.StringIO (#149047) 2026-06-01 13:01:57 +00:00
_multiprocessing gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_remote_debugging gh-149931: Fix memory leaks on failed realloc (#149932) 2026-05-26 01:37:14 +01:00
_sqlite gh-149738: Fix segmentation fault bug in sqllite3 (#149754) 2026-06-02 11:07:08 +02:00
_sre gh-150319: Replace all documentation which says "See PEP 585" (#150325) 2026-06-02 21:13:34 +01:00
_ssl gh-146207: Add support for OpenSSL 4.0.0 alpha1 (#146217) 2026-03-25 07:44:47 +01:00
_testcapi gh-150114: Log the memory usage in regrtest on macOS (gh-150396) 2026-05-26 00:03:06 +09:00
_testinternalcapi gh-148871: make LOAD_COMMON_CONSTANT use immortal stackref borrows (GH-149625) 2026-05-28 12:27:37 +01:00
_testlimitedcapi gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_xxtestfuzz Update and expand the 'Fuzz Tests for CPython' README (#148270) 2026-04-09 08:52:30 +01:00
_zstd gh-150285: Fix too long docstrings in the zstd module (GH-150291) 2026-05-24 15:03:22 +03:00
cjkcodecs gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
clinic Correct frexp() docs for zero and non-finite numbers (GH-149753) 2026-05-31 07:29:44 +00:00
expat gh-149698: Update bundled expat to 2.8.1 (GH-149699) 2026-05-14 01:21:03 +02:00
_abc.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_asynciomodule.c gh-150319: Replace all documentation which says "See PEP 585" (#150325) 2026-06-02 21:13:34 +01:00
_bisectmodule.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_bz2module.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_codecsmodule.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_collectionsmodule.c gh-150319: Replace all documentation which says "See PEP 585" (#150325) 2026-06-02 21:13:34 +01:00
_csv.c gh-145105: Fix crash in csv.reader with re-entrant iterator (GH-145106) 2026-04-11 15:18:02 -07:00
_curses_panel.c gh-150285: Fix too long docstrings in the curses module (GH-150286) 2026-05-24 15:02:12 +03:00
_cursesmodule.c gh-150285: Fix too long docstrings in the curses module (GH-150286) 2026-05-24 15:02:12 +03:00
_datetimemodule.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_dbmmodule.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_elementtree.c gh-149571: Fix the C implementation of Element.itertext() (GH-149929) 2026-05-27 13:23:28 +03:00
_functoolsmodule.c gh-150319: Replace all documentation which says "See PEP 585" (#150325) 2026-06-02 21:13:34 +01:00
_gdbmmodule.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_hashopenssl.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_heapqmodule.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_interpchannelsmodule.c gh-149921: Fix reference leaks in _interpchannels and _interpqueues modules (#149922) 2026-05-17 13:09:19 +03:00
_interpqueuesmodule.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_interpreters_common.h gh-132775: Use _PyObject_GetXIData (With Fallback) (gh-134440) 2025-05-22 06:50:06 -06:00
_interpretersmodule.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_json.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_localemodule.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
_lsprof.c gh-145846: Fix memory leak in _lsprof clearEntries() context chain (#145847) 2026-04-07 22:56:19 +02:00
_lzmamodule.c gh-115988: Add ARM64 and RISCV BCJ filters constants in lzma module (GH-115989) 2026-05-28 08:05:03 -07:00
_math.h gh-122681: remove m_atan2()/c_atan2() helpers (#122715) 2024-08-17 13:48:16 +05:30
_opcode.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_operator.c GH-145247: Use _PyTuple_FromPair in Modules (part 1) (#148000) 2026-04-02 23:20:13 +02:00
_pickle.c gh-150157: Fix critical section for PyDict_Next() in _pickle.c (GH-150158) 2026-06-01 17:32:13 +03:00
_posixsubprocess.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_queuemodule.c gh-150319: Replace all documentation which says "See PEP 585" (#150325) 2026-06-02 21:13:34 +01:00
_randommodule.c gh-149816: Fix a RC in _random.Random.__init__ method (#149824) 2026-05-18 18:39:54 +03:00
_scproxy.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
_ssl.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_ssl.h GH-103092: isolate _ssl (#104725) 2023-05-22 06:14:48 +05:30
_ssl_data_36.h gh-149254: Update CI to use latest OpenSSL and AWS-LC versions (GH-149330) 2026-05-03 20:20:51 +00:00
_ssl_data_40.h gh-148600: Add Modules/_ssl_data_40.h data (#148601) 2026-04-15 15:59:02 +02:00
_ssl_data_111.h gh-131423: Update OpenSSL data to 3.4.1 on Linux (#131618) 2025-04-25 10:26:58 +02:00
_ssl_data_300.h gh-127330: Update for OpenSSL 3.4 & document+improve the update process (GH-127331) 2024-11-28 13:29:27 +01:00
_ssl_data_340.h gh-131423: Update OpenSSL data to 3.4.1 on Linux (#131618) 2025-04-25 10:26:58 +02:00
_stat.c gh-108765: fix comment about macro definitions in _stat.c post GH-108854 (#136027) 2025-06-27 15:15:11 +00:00
_statisticsmodule.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
_struct.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_suggestions.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
_sysconfig.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
_testbuffer.c gh-146151: memoryview supports 'F' and 'D' format types (complex) (#146241) 2026-03-26 15:26:34 +01:00
_testcapi_feature_macros.inc gh-91325: Skip Stable ABI checks with Py_TRACE_REFS special build (GH-92046) 2024-01-29 16:45:31 +01:00
_testcapimodule.c gh-149101: Implement PEP 788 (GH-149116) 2026-05-06 17:39:30 -04:00
_testclinic.c gh-144545: Improve handling of default values in Argument Clinic (GH-146016) 2026-03-17 12:16:35 +02:00
_testclinic_limited.c gh-116322: Rename PyModule_ExperimentalSetGIL to PyUnstable_Module_SetGIL (GH-118645) 2024-05-06 18:59:36 +02:00
_testimportmultiple.c gh-116322: Add Py_mod_gil module slot (#116882) 2024-05-03 11:30:55 -04:00
_testinternalcapi.c gh-149879: Fix test_capi on Cygwin (#150252) 2026-05-22 21:47:32 +02:00
_testlimitedcapi.c gh-149044: Implement PEP 820 – PySlot: Unified slot system for the C API (GH-149055) 2026-05-05 09:18:04 +02:00
_testmultiphase.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_testsinglephase.c gh-145921: Add "_DuringGC" functions for tp_traverse (GH-145925) 2026-04-08 09:15:11 +02:00
_threadmodule.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_tkinter.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_tracemalloc.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
_typesmodule.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
_typingmodule.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
_uuidmodule.c gh-132710: only use stable _uuid.generate_time_safe() to deduce MAC address (#132901) 2025-05-26 10:56:31 +02:00
_weakref.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
_winapi.c gh-150114: Log the memory usage in regrtest on Windows (#150267) 2026-05-23 00:04:51 +02:00
_zoneinfo.c gh-145883: Fix two heap-buffer-overflows in _zoneinfo (#145885) 2026-04-04 13:29:17 +01:00
addrinfo.h gh-114917: add support for AI_NUMERICSERV in getaddrinfo emulation (#114918) 2025-03-18 11:26:51 +01:00
arraymodule.c gh-150319: Replace all documentation which says "See PEP 585" (#150325) 2026-06-02 21:13:34 +01:00
atexitmodule.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
binascii.c gh-134837: Correct and improve base85 documentation for base64 and binascii modules (GH-145843) 2026-05-12 22:46:46 +03:00
blake2module.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
cmathmodule.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
config.c.in gh-128384: Use a context variable for warnings.catch_warnings (gh-130010) 2025-04-09 16:18:54 -07:00
errnomodule.c gh-126585: Add EHWPOISON error code (#126586) 2024-12-03 12:45:50 +00:00
faulthandler.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
fcntlmodule.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
gc_weakref.txt GH-135552: Make the GC clear weakrefs later (GH-136189) 2025-08-07 16:32:17 -07:00
gcmodule.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
getaddrinfo.c gh-114917: Fix typo in getaddrinfo emulation (#131413) 2025-03-18 14:31:13 +01:00
getbuildinfo.c gh-100388: Change undefined __DATE__ to the Unix epoch (#100389) 2025-03-03 14:59:46 +01:00
getnameinfo.c Replace K&R function declarations with ANSI declarations (#114818) 2025-03-11 13:06:36 +01:00
getpath.c GH-131296: Avoid invalid signed char comparison in getpath.c assertion (GH-131594) 2025-04-22 14:06:30 +01:00
getpath.py GH-145273: don't skip missing platstdlib warning if stdlib_zip is found (#145544) 2026-03-09 19:37:33 +00:00
getpath_noop.c bpo-45582: Port getpath[p].c to Python (GH-29041) 2021-12-03 00:08:42 +00:00
grpmodule.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
hashlib.h gh-131876: Revert "gh-131876: extract _hashlib helpers into a separate directory (#136995) (#137307) 2025-08-01 10:45:40 -07:00
hmacmodule.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
itertoolsmodule.c gh-150319: Replace all documentation which says "See PEP 585" (#150325) 2026-06-02 21:13:34 +01:00
ld_so_aix.in
main.c GH-145247: Use _PyTuple_FromPair in Modules (part 1) (#148000) 2026-04-02 23:20:13 +02:00
makesetup gh-116943: Ensure makesetup does not choke on missing EOL in Setup.* files (#139100) 2025-09-18 09:25:01 +00:00
makexp_aix bpo-42087: Remove support for AIX 5.3 and below (GH-22830) 2020-11-16 16:16:10 +01:00
mathintegermodule.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
mathmodule.c Correct frexp() docs for zero and non-finite numbers (GH-149753) 2026-05-31 07:29:44 +00:00
md5module.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
mmapmodule.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
overlapped.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
posixmodule.c gh-150319: Replace all documentation which says "See PEP 585" (#150325) 2026-06-02 21:13:34 +01:00
posixmodule.h gh-85283: Convert grp extension to the limited C API (#116611) 2024-03-12 00:46:53 +00:00
pwdmodule.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
pyexpat.c gh-150560: Fix crash in XML parser on invalid XML with multi-byte encoding (GH-150568) 2026-05-30 00:23:32 +03:00
readline.c gh-150372: Add missing null check on completer_word_break_characters in readline.c (GH-150251) 2026-05-30 19:26:05 +00:00
README
resource.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
rotatingtree.c gh-116181: Remove Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE in rotatingtree.c (#121260) 2024-07-03 13:05:05 +05:30
rotatingtree.h
selectmodule.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
Setup gh-140550: Update xxlimited with 3.15 limited API (GH-142827) 2026-05-13 18:35:50 +02:00
Setup.bootstrap.in gh-136421: Load _datetime static types during interpreter initialization (GH-136583) 2025-07-21 13:47:26 -04:00
Setup.stdlib.in gh-140550: Update xxlimited with 3.15 limited API (GH-142827) 2026-05-13 18:35:50 +02:00
sha1module.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
sha2module.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
sha3module.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
signalmodule.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
socketmodule.c gh-150406: Check result of PyThread_allocate_lock() for netdb_lock (GH-150407) 2026-05-30 16:25:40 +00:00
socketmodule.h gh-86819: Add ISO-TP CAN socket constants (#23794) 2025-09-17 17:18:04 +00:00
symtablemodule.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
syslogmodule.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
termios.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00
timemodule.c gh-149931: Fix memory leaks on failed realloc (#149932) 2026-05-26 01:37:14 +01:00
tkappinit.c gh-103538: Remove unused TK_AQUA code (GH-103539) 2023-05-10 18:53:13 +00:00
tkinter.h gh-103532: Remove TKINTER_PROTECT_LOADTK code (GH-103535) 2023-04-14 09:04:16 -05:00
unicodedata.c gh-149079: Fix O(n^2) canonical ordering in unicodedata.normalize() (GH-149080) 2026-06-02 11:39:50 +02:00
unicodedata_db.h gh-66802: Add unicodedata.block() function (#145042) 2026-02-21 18:27:55 +01:00
unicodename_db.h gh-144882: Optimize name tables in unicodedata by excluding names derived by rule NR2 (GH-144883) 2026-02-18 12:58:21 +02:00
winreparse.h
xxlimited.c gh-140550: Update xxlimited with 3.15 limited API (GH-142827) 2026-05-13 18:35:50 +02:00
xxlimited_3_13.c gh-140550: Update xxlimited with 3.15 limited API (GH-142827) 2026-05-13 18:35:50 +02:00
xxlimited_35.c gh-140550: Update xxlimited with 3.15 limited API (GH-142827) 2026-05-13 18:35:50 +02:00
xxmodule.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
xxsubtype.c gh-128341: Use _Py_ABI_SLOT in stdlib modules (#145770) 2026-03-24 17:47:55 +00:00
zlibmodule.c gh-150285: Fix too long docstrings in Argument Clinic code (GH-150338) 2026-05-24 16:16:12 +03:00

Source files for standard library extension modules,
and former extension modules that are now builtin modules.