Commit graph

14627 commits

Author SHA1 Message Date
Thomas A Caswell
201d251567
DOC: clarify and expand documentation about PYTHONUSERBASE and PYTHONNOUSERSITE (#144637) 2026-03-02 15:54:26 +00:00
edson duarte
6c417e44c9
gh-140715: Improve class reference links on datetime.rst (#123980)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-03-01 13:59:02 +02:00
Jelle Zijlstra
3484ef6003
gh-145033: Implement PEP 747 (#145034) 2026-02-28 19:52:04 -08:00
Zachary Ware
f1446d3922
Destroy the turtle window after its doctests finish (GH-125294) 2026-02-28 21:12:05 +00:00
Nathan Goldbaum
fdb4b3527f
gh-145269: simplify bisect.bisect doc example (#145270)
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>

---------

Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
2026-02-28 09:09:39 +00:00
Rajhans Jadhao
e234662f7f
gh-144190: Clarify get_type_hints() instance behavior in docs (#144831) 2026-02-26 15:47:13 +02:00
Adorilson Bezerra
aa2c0c3acb
gh-106318: Add examples for str.rjust() method (#143890) 2026-02-26 15:41:49 +02:00
Lysandros Nikolaou
017ccd3bf4
gh-142518: Move thread safety sections into a new page (#144716)
- Create a new page for thread safety notes for built-in types
- Move thread safety notes for `list` into the new page
- Move thread safety notes for `dict` into the new page
---------

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-25 16:49:46 +01:00
Tadej Magajna
12828e5f98
gh-85809: Ensure shutil.make_archive accepts path-like objects in all cases (GH-143668) 2026-02-25 16:44:17 +02:00
Philipp A.
ae7fc4a4f6
gh-110937: Document full public importlib.metadata.Distribution API (#143480) 2026-02-23 18:51:03 -05:00
Savannah Ostrowski
6194a552f2
Update argparse suggest_on_error code snippet in docs (#144985) 2026-02-23 17:25:05 +00:00
Stan Ulbrych
f1f61bf872
gh-66802: Add unicodedata.block() function (#145042)
Closes #66802
2026-02-21 18:27:55 +01:00
Mohsin Mehmood
85021bc247
gh-144694: Fix re.Match.group() doc claiming [1..99] range limit (#144696)
The documentation incorrectly stated that numeric group arguments
must be in the range [1..99]. This limit was removed in Python 3.5
(bpo-22437). Replace with "a positive integer" since the next
sentence already documents the IndexError for out-of-range values.
2026-02-20 21:36:26 -08:00
Raymond Hettinger
8246d588e4
Simplify summary tables in the itertools docs (gh-145050)
Combine two dispatch tables into once.
2026-02-20 12:44:30 -06:00
Ned Batchelder
852ec18978
Docs: remove unneeded author attributions (#145002)
These directives are not maintained and misleadingly indicate individual
rather than community ownership.

See https://github.com/python/docs-community/issues/180 for discussion,
and https://github.com/python/devguide/pull/1740 for an update to the
devguide.

Also ensured that everyone is in the Misc/ACKS file.
2026-02-19 18:45:28 -05:00
Victor Stinner
beb8e3f276
gh-141510: Document ParameterizedMIMEHeader.params change (#145003)
Document also the dataclasses.field() metadata change.
2026-02-19 22:13:16 +01:00
Filipe Laíns
157f271de3
gh-139899: Introduce MetaPathFinder.discover and PathEntryFinder.discover (#139900)
* gh-139899: Introduce MetaPathFinder.discover and PathEntryFinder.discover

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Fix doc reference

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Remove specific doc references

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Fix docstrings

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Revert "Remove specific doc references"

This reverts commit 31d1a8f551.

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Fix news references

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Add docs warning

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Raise ValueError on invalid parent

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Dedupe __path__ in PathFinder.discover

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Use context manager and add error handling to os.scandir

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Raise ValueError on invalid parent

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Dedupe when package exists with multiple suffixes

Signed-off-by: Filipe Laíns <lains@riseup.net>

* Apply suggestions from code review

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>

* Add tests

Signed-off-by: Filipe Laíns <lains@riseup.net>

---------

Signed-off-by: Filipe Laíns <lains@riseup.net>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Brett Cannon <brett@python.org>
2026-02-19 15:25:50 +00:00
Stan Ulbrych
20caf1c084
Remove unused :platform: in module's docs (GH-144988)
It has not been outputted since Sphinx 1.1.
2026-02-19 13:45:30 +02:00
Stan Ulbrych
c6a142f947
Datetime: Tidy up docs (GH-144720)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-02-18 14:22:34 +01:00
Petr Viktorin
112d8ac972
gh-141984: Reword and reorganize the first part of Atoms docs (GH-144117)
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-18 14:13:21 +01:00
Victor Stinner
e779777c66
gh-141510: Mention frozendict in dict documentation (#144934)
test_genericalias now tests also frozendict.
2026-02-17 23:03:22 +01:00
Victor Stinner
696cdfc0a2
gh-141510, PEP 814: Add built-in frozendict type (#144757)
Add TYPE_FROZENDICT to the marshal module.

Add C API functions:

* PyAnyDict_Check()
* PyAnyDict_CheckExact()
* PyFrozenDict_Check()
* PyFrozenDict_CheckExact()
* PyFrozenDict_New()

Add PyFrozenDict_Type C type.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Adam Johnson <me@adamj.eu>
Co-authored-by: Benedikt Johannes <benedikt.johannes.hofer@gmail.com>
2026-02-17 10:54:41 +01:00
Jason Yalim, PhD
185a6e942a
gh-140715: Add %D format code support to strptime() (GH-144819)
* %D support for strptime, including test and Doc update
* additional %D test
* change documentation example date for %D so it is more legible to non-US readers
* change testing date for %D so it is more legible to non-US readers
* mv News blurb to Library, consistent with previous %F change
* change invalid format code from %D to C-standard unused %!
* Fix erroneous and misleading example Doc to %y from %Y, use correct C99+ definition for C99 %D; update additional tests

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2026-02-16 14:20:37 -08:00
sblondon
837166f099
bpo-32234: Allow mailbox instances as context managers (GH-4770)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: R. David Murray <rdmurray@bitdance.com>
2026-02-16 14:14:26 +01:00
Gregory P. Smith
300de1e98a
gh-86519: Add prefixmatch APIs to the re module (GH-31137)
Adds `prefixmatch` APIs to the re module as an alternate name for our long existing `match` APIs to help alleviate a common Python confusion for those coming from other languages regular expression libraries.

These alleviate common confusion around what "match" means as Python is different than other popular languages regex libraries in our use of the term as an API name.  The original `match` names are **NOT being deprecated**.  Source tooling like linters, IDEs, and LLMs could suggest using `prefixmatch` instead of match to improve code health and reduce cognitive burden of understanding the intent of code when configured for a modern minimum Python version.

See the documentation changes for a better description.

Discussions took place in the PR, in the issue, and finally at https://discuss.python.org/t/add-re-prefixmatch-deprecate-re-match/105927

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 17:43:39 -08:00
Rafael Weingartner-Ortner
629a363ddd
gh-136672: Docs: Move parts of Enum HOWTO to API Docs (GH-139176)
To avoid duplicate content in the Enum HOWTO and
API documentation which is not automatically synced,
the section about supported __dunder__ and _sunder
names is moved from HOWTO to API docs.

See also https://github.com/python/cpython/pull/136791
2026-02-13 11:51:56 -08:00
Robsdedude
945bf8ce1b
gh-144706: Warn against using synchronization primitives within signal handlers (GH-144736) 2026-02-12 18:15:23 -05:00
Stan Ulbrych
2e3e76e5cd
gh-57095: Add note about input splitting in datetime.*.strptime (GH-131049)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-02-12 11:35:42 +01:00
Adorilson Bezerra
f912c835b9
gh-106318: Fix incorrectly rendered code block in str.isalnum() docs (GH-144718) 2026-02-12 08:40:17 +01:00
Pablo Galindo Salgado
46d5106cfa
gh-142349: Implement PEP 810 - Explicit lazy imports (#142351)
Co-authored-by: T. Wouters <twouters@meta.com >
Co-authored-by: Brittany Reynoso <breynoso@meta.com>
Co-authored-by: Dino Viehland <dinoviehland@meta.com>
2026-02-12 00:15:33 +00:00
Ronald Eddy Jr
3718f4be60
Fix typos and grammar errors across documentation (#144709) 2026-02-11 16:35:25 +00:00
Hugo van Kemenade
cf23fcd5f7 Merge branch 'main' of https://github.com/python/cpython 2026-02-11 17:34:44 +02:00
Lysandros Nikolaou
35dc547ab5
gh-142518: Document thread-safety guarantees of dict operations (#144184)
* Address feedback; move thread safety section below see-also
* Address feedback - don't mention equality comparison only
* Change admonition to rubric; cross-reference glossary

---------

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-02-11 14:33:00 +01:00
Ned Batchelder
37430cac94
Docs: remove links of modules to themselves (#144695) 2026-02-11 07:56:36 -05:00
Lysandros Nikolaou
12dbae4c02
gh-142518: Define lock-free and per-object lock (#144548)
- Add definitions of lock-free and per-object lock to the glossary
- Cross-reference these from list thread safety notes
- Change admonition to rubric
2026-02-11 13:55:36 +01:00
Hugo van Kemenade
15b216f30d Python 3.15.0a6 2026-02-11 14:23:15 +02:00
Adorilson Bezerra
936d60dbe1
gh-106318: Improve str.rstrip() method doc (#143893)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-11 09:41:37 +01:00
László Kiss Kollár
d18dbd5e1c
gh-138122: Add sampling profiler visualisation to docs (#142772)
Co-authored-by: Pablo Galindo Salgado <pablogsal@gmail.com>
2026-02-10 23:09:07 +00:00
Dov Murik
87c9789b9a
docs: profiling.sampling: Fix sampling-rate default value description typo (#144686) 2026-02-10 21:55:40 +00:00
Hugo van Kemenade
b4a620d2d7
gh-133879: Copyedit "What's new in Python 3.15" (#144661)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-10 18:49:20 +02:00
Aarni Koskela
40a82abe93 Clarify the docs for args in asyncio callbacks (#143873)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2026-02-10 13:10:01 +00:00
kovan
9b8d59c136
gh-72798: Add mapping example to str.translate documentation (#144454)
Add an example showing how to use str.translate() with a dictionary
mapping directly, demonstrating character replacement and deletion.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-10 11:13:40 +01:00
Bartosz Sławecki
ff531f9005
gh-132604: Deprecate inherited runtime checkability of protocols (GH-143806)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2026-02-09 15:13:47 +01:00
Jason Yalim, PhD
d99f3fc474
gh-140715: Add %F format code support to strptime() (GH-140647)
Also: add tests for the `%T` format code

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-09 13:24:15 +01:00
Adorilson Bezerra
432ddd99e2
gh-106318: Add examples for str.partition() method (#142823) 2026-02-09 00:10:43 +02:00
Adorilson Bezerra
3dd7a3c65a
gh-106318: Add example for str.isalnum() (#137550) 2026-02-09 00:08:18 +02:00
Guo Ci
d73634935c
For enum.bin, update versionadded directive from 3.10 to 3.11 (#144574) 2026-02-07 23:35:02 -08:00
Bénédikt Tran
934997218e
gh-143700: document secrets.DEFAULT_ENTROPY as an opaque value (#144568) 2026-02-07 23:36:42 +01:00
Guo Ci
6665115679
gh-84116: Add missing backslash to _SubParsersAction.add_parser signature (#144572) 2026-02-07 19:02:01 +01:00
kovan
0e7c06a858
gh-142044: Add note to prefer asyncio.timeout[_at] over asyncio.Timeout (#144449) 2026-02-07 12:22:51 +00:00