Commit graph

30593 commits

Author SHA1 Message Date
Bartosz Sławecki
0499a0c17f
gh-144285: Update *What's New* entry after GH-144299 (#145077) 2026-02-21 12:50:55 +00:00
Bénédikt Tran
34f4fa8425
gh-141226: Deprecate PEP-456 support for embedders (#141287)
Deprecate PEP-456 [1] support for providing an external definition
of the string hashing scheme. Removal is scheduled for Python 3.19.

Previously, embedders could define the ``Py_HASH_ALGORITHM`` macro to be
``Py_HASH_EXTERNAL`` [2] to indicate that the hashing scheme was provided
externally but this feature was undocumented, untested and most likely
unused.

[1]: https://peps.python.org/pep-0456/
[2]: https://peps.python.org/pep-0456/#hash-function-selection
2026-02-21 12:42:13 +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
Peter Bierma
06292614ff
gh-144748: Document 3.12 and 3.14 changes to PyErr_CheckSignals (GH-144982)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2026-02-20 19:25:45 -05: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
Peter Bierma
60f3c396fe
gh-141811: Split up init.rst into multiple pages (GH-144844)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Benedikt Johannes <benedikt.johannes.hofer@gmail.com>
2026-02-20 16:37:39 +00: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
Donghee Na
52794cba13
gh-141510: Update Whats News for frozendict (gh-144961) 2026-02-19 12:48:57 +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
Serhiy Storchaka
9e8fa2d4d1
gh-144386: Update equivalent code for "with", "async with" and "async for" (GH-144472)
They use special method lookup for special methods.
2026-02-18 13:13:32 +02:00
Ned Batchelder
7a7521bcfa
Docs: an "improve this page" feature (#144939)
* Docs: a start on an 'improve this page' feature

* pr feedback: simplify the link, and don't scare people with the cla

* pr feedback answered

- use the actual page URL
- tighten the wording

* fix the improve link on the improve page

* news item

* Update Doc/improve-page.rst

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>

* fix whitespace

* A nojs version of the page

* comments to help people keep the two pages in sync

* protect against XSS

* use template for issues from the nojs page

* use the template from the JS page as well

* give the docs issue template a fillable description field

* ugh, getting sloppy

* remove more sloppiness

---------

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-02-18 04:58:30 -05:00
Stan Ulbrych
6f7e3d4408
Docs: Remove unnecessary entry from nitpick_ignore (GH-144933) 2026-02-18 08:52:04 +01:00
Kumar Aditya
836f2c97f9
gh-144914: use mimalloc for raw allocations on free-threading (#144916) 2026-02-18 04:16:27 +00: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
Kumar Aditya
50c479e613
add whatsnew entry for PyUnstable_SetImmortal and PyDatetime_IMPORT (#144830) 2026-02-15 20:21:54 +05:30
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
Victor Stinner
9e5e1f9988
gh-121617: Include <string.h> for Py_CLEAR() macro (#144666)
Python.h now also includes <string.h> in the limited C API version 3.11
and newer to fix the Py_CLEAR() macro which uses memcpy().

Add a Py_CLEAR() test in test_cext.

Modify also _Py_TYPEOF to use C23 typeof() if available.
2026-02-12 17:03:55 +01: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
Kumar Aditya
347d3594d3
gh-143300: implement PyUnstable_SetImmortal for marking objects as immortal (#144543) 2026-02-11 20:59:31 +05:30
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
Sergey B Kirpichev
aa6ed802f2
gh-119740: Remove obsoleted removal announce for trunc delegation (GH-144622)
This was done in GH-119743 (3.14).
2026-02-09 13:41:05 +02:00
Petr Viktorin
b22ff1e543
gh-140550: allow slots that repeat information from PyModuleDef (GH-144340)
When integrating slots-based module creation is with the inittab,
which currently requires PyModuleDef, it would be convenient to
reuse the the same slots array for the MethodDef.

Allow slots that match what's already present in the PyModuleDef.
2026-02-09 11:35:43 +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