Commit graph

29602 commits

Author SHA1 Message Date
Miss Islington (bot)
423f620f31
[3.13] gh-101100: Document os.uname_result and os.statvfs_result with related constants (GH-151301) (GH-151691)
(cherry picked from commit 9688d252d3)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2026-06-19 08:42:41 +00:00
Miss Islington (bot)
e87e0ad27d
[3.13] gh-151427: add 'not macOS' and 'not iOS' restrictions on availability state of some functions in os module. (GH-151537) (#151697)
(cherry picked from commit da69fcf98d)
Co-authored-by: Duprat <yduprat@gmail.com>
2026-06-19 08:17:02 +00:00
Serhiy Storchaka
aae671d484
[3.13] gh-86726: Fix the documented return type of tkinter info_patchlevel() (GH-151655) (GH-151660)
It returns a sys.version_info-like named tuple, not a string.
(cherry picked from commit 3cd02a1c2d)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 14:44:23 +00:00
Serhiy Storchaka
33b9f75c58
[3.13] gh-86726: Document the full public API of tkinter (GH-151579) (GH-151650) (GH-151653)
Replace the previously sparse reference documentation with full coverage of
the public API of the tkinter package, written from the Tcl/Tk manual pages,
the existing documentation and the module docstrings.

* Doc/library/tkinter.rst gains a "Reference" section documenting every public
  class, method, function and constant of the core module -- the widgets, the
  Misc, Wm, Pack, Place, Grid, XView and YView mix-ins, the Variable and image
  classes, the module-level functions and the symbolic constants.
* Doc/library/tkinter.ttk.rst, dialog.rst, tkinter.font.rst and the other
  module pages document their remaining classes, methods and functions.

The descriptions are Python-oriented (correct return types -- tuples rather
than Tcl lists, booleans, integers, None on cancellation, and so on) and were
checked against the Tcl/Tk 9.1 manual pages and the implementation.

versionadded, versionchanged and deprecated directives are added for the
public API, determined from the git history relative to Python 3.0: the
tkinter.ttk module (3.1); the Text, Wm, Menu and Misc methods exposing Tk 8.5
features (3.3); and the many later additions and behavior changes up to 3.15.
The Tk version required by features added after Tk 8.6 is noted as well.  The
bundled Tcl/Tk version is updated to 9.0 and the manual-page links point at
the tcl9.0 reference.

--------
(cherry picked from commit 8b270b72a2)





* gh-86726: Adjust tkinter docs for the 3.14 backport

Remove documentation of API added only in 3.15 (the grid_content/
pack_content/place_content aliases, Text.search_all, the search
nolinestop/strictlimits parameters and Event.user_data/detail), date the
wm_attributes positional-argument deprecation to 3.13, and update the
bundled Tcl/Tk version to 8.6.



---------
(cherry picked from commit 1141d294ee)

Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2026-06-18 13:32:37 +00:00
Hugo van Kemenade
f57b80cd2e
[3.13] gh-151623: Improve curses documentation style (GH-151635) (#151638) 2026-06-18 10:10:37 +00:00
Serhiy Storchaka
805830831f
[3.13] gh-151623: Improve curses documentation and docstrings (GH-151625) (GH-151629) (GH-151630)
(cherry picked from commit 015cc42bc2)

Fix errors and clarify the curses, curses.panel and curses.ascii docs
against X/Open Curses and ncurses, and sync the affected docstrings.
(cherry picked from commit 65afcdd8df)
2026-06-18 09:51:51 +00:00
Miss Islington (bot)
fa8bf7df09
[3.13] gh-139837: Document attributes of objects recorded by warnings.catch_warnings (GH-139893) (GH-151473) (#151494)
[3.14] gh-139837: Document attributes of objects recorded by warnings.catch_warnings (GH-139893) (GH-151473)

* gh-139837: Document attributes of objects recorded by warnings.catch_warnings (GH-139893)
(cherry picked from commit 47b7dc788c)




* Apply suggestions from code review



---------
(cherry picked from commit eb612f4571)

Co-authored-by: Aniket <148300120+Aniketsy@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-15 09:30:46 +00:00
Hugo van Kemenade
6971e05978
[3.13] Add a new Sphinx soft-deprecated directive (GH-148630) (#148715)
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-14 19:08:04 +03:00
Miss Islington (bot)
348622a96d
[3.13] gh-151443: Fix documented default of unittest.mock.mock_open's read_data parameter (GH-151444)
(cherry picked from commit 9ad6ba0324)

Co-authored-by: Shardul Deshpande <iamsharduld@users.noreply.github.com>
2026-06-13 18:37:47 +00:00
Miss Islington (bot)
52ee4d8e8d
[3.13] Docs: Fix method directive signatures in enum docs (GH-151429) (#151433)
(cherry picked from commit 5b38519762)

Co-authored-by: Jonathan Dung <jonathandung@yahoo.com>
2026-06-13 08:55:39 +00:00
Miss Islington (bot)
a1d247f357
[3.13] Fix typos in the curses.ascii module documentation (GH-129300) (#151415)
(cherry picked from commit f4f102027a)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-12 16:09:38 +00:00
Hugo van Kemenade
ebc2a625ad
[3.13] Docs: avoid repetitions of class references in functions.rst (GH-150891) (#151407)
Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
2026-06-12 18:04:54 +03:00
Miss Islington (bot)
5bc20725e2
[3.13] gh-138991: Update dataclass documentation for new eq behavior in Python 3.13 (GH-139007) (#151374)
gh-138991: Update dataclass documentation for new eq behavior in Python 3.13 (GH-139007)

And add tests.
(cherry picked from commit 402668b2b1)

Co-authored-by: Aniket <148300120+Aniketsy@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-11 17:39:04 +00:00
Miss Islington (bot)
bba688665f
[3.13] gh-101100: Fix Sphinx nitpick in unittest.mock.rst (GH-151302)
(cherry picked from commit b18168cb32)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2026-06-11 16:38:41 +01:00
Hugo van Kemenade
06dce35b5a
[3.13] gh-130796: Undeprecate locale.getdefaultlocale() (GH-143069) (#151318)
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-11 14:34:40 +03:00
Miss Islington (bot)
d5468ba70b
[3.13] gh-136880: Add warning about PYTHONPATH (GH-151098) (GH-151298)
(cherry picked from commit 84630e2cb9)
2026-06-11 07:38:47 +01:00
Victor Stinner
a1f43ef9d9
[3.13][3.14] gh-89554: Document socket.SocketType as a class (#150683) (#151245) (#151254)
[3.14] gh-89554: Document socket.SocketType as a class (#150683) (#151245)

gh-89554: Document socket.SocketType as a class (#150683)

socket.SocketType is a class (re-exported from _socket as an alias of
_socket.socket, the base class of socket.socket), but was documented with
the ".. data::" directive, so ":class:" cross-references to it cannot
resolve against a py:class target.

Switch the entry to ".. class::", correct the misleading description
(SocketType is the base class of the socket type, not "type(socket(...))"
which is socket.socket; addresses gh-88427), move it into the Socket
Objects section, and document the socket object methods and attributes
nested under the socket class, dropping the redundant "socket." prefix.

Backport to 3.13: Replace ":platform: Windows" with
".. availability:: Windows" in ioctl() method.

(cherry picked from commit a621e8ad81)


(cherry picked from commit 4ef6a375a1)

Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
2026-06-10 19:02:34 +02:00
Thomas Wouters
3a04c62e38 Merge branch '3.13' of https://github.com/python/cpython into 3.13 2026-06-10 18:01:42 +02:00
Miss Islington (bot)
60123e619a
[3.13] Docs: Fix typos in the "Memory Management" section (GH-151243)
(cherry picked from commit 8c0e2515bb)

Co-authored-by: Manoj K M <manojkm24dev@gmail.com>
2026-06-10 13:20:03 +00:00
Thomas Wouters
fd17997c38 Python 3.13.14 2026-06-10 14:24:04 +02:00
Miss Islington (bot)
52ee56a88e
[3.13] gh-80384: Fix docs for PyWeakref_NewRef() and PyWeakref_NewProxy() (GH-151146) (GH-151233)
The type of the callback argument is not checked.
(cherry picked from commit 0b6adeb20f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2026-06-10 10:48:23 +00:00
Abduaziz π
99dc88db09
[3.13] gh-132467: Document and test that generic aliases are not classes (GH-133504) (#151117)
(cherry picked from commit 5915a1fb9d)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2026-06-09 22:24:02 +02:00
Miss Islington (bot)
fc600e4178
[3.13] gh-101100: Fix Sphinx warnings in 'Buffer Object Structures' documentation (GH-151058) (#151071)
(cherry picked from commit a1873300ee)

Co-authored-by: Christian Zinck <christian.zinck@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-09 22:21:51 +02:00
Savannah Ostrowski
848b9823bc
[3.13] GH-59633: Clarify dest collisions in argparse docs (GH-150987) (#151196)
(cherry picked from commit 82cb7d4bf6)
2026-06-09 17:26:45 +00:00
Miss Islington (bot)
b032f3fa17
[3.13] GH-54732: Tweak wording around empty lines in argument files (GH-150980) (#151167)
GH-54732: Tweak wording around empty lines in argument files (GH-150980)
(cherry picked from commit 528550e0e7)

Co-authored-by: Savannah Ostrowski <savannah@python.org>
2026-06-09 15:44:18 +00:00
Miss Islington (bot)
558764600f
[3.13] GH-61082: Clarify nargs='*' positional default behavior (GH-150989) (#151170)
GH-61082: Clarify nargs='*' positional default behavior (GH-150989)
(cherry picked from commit bc37a227b2)

Co-authored-by: Savannah Ostrowski <savannah@python.org>
2026-06-09 15:44:07 +00:00
Stan Ulbrych
19bc39127e
[3.13] gh-90949: expose Expat API to tune exponential expansion protections (GH-139368)
Expose the XML Expat 2.7.2 APIs to tune protections against
"billion laughs" [1] attacks.

The exposed APIs are available on Expat parsers, that is,
parsers created by `xml.parsers.expat.ParserCreate()`, as:

- `parser.SetBillionLaughsAttackProtectionActivationThreshold(threshold)`, and
- `parser.SetBillionLaughsAttackProtectionMaximumAmplification(max_factor)`.

This completes the work in f04bea44c3,
and improves the existing related documentation.

[1]: https://en.wikipedia.org/wiki/Billion_laughs_attack
(cherry picked from commit 666112376d)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-06-09 15:23:22 +01:00
Miss Islington (bot)
c68571c4bf
[3.13] gh-109503: Fix document for shutil.move() on usage of os.rename() since it's inaccurate (GH-109507) (GH-150613)
Nonatomic move might be used even if the files are
on the same filesystem in some cases.
(cherry picked from commit 6ecd197c03)

Co-authored-by: Fang Li <fangli@users.noreply.github.com>
2026-06-09 16:06:55 +03:00
Miss Islington (bot)
de9ed78486
[3.13] gh-151070: Fix class referencing typo in collections.abc docs (GH-151088) (GH-151108)
(cherry picked from commit 29a920e80e)

Co-authored-by: Arshal Aromal <arshalaromal19@gmail.com>
2026-06-08 19:45:16 +00:00
Miss Islington (bot)
4e2285cf52
[3.13] gh-106318: Add examples to the str.isdigit() method docs (GH-144721)
(cherry picked from commit f051c68923)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-08 12:58:26 +00:00
Miss Islington (bot)
45d1ba7bb8
[3.13] gh-141623: operator.rst: don't use term "bitwise" (GH-141846) (GH-151080)
(cherry picked from commit bd5fa31c5f)

Co-authored-by: Doron Behar <doron.behar@gmail.com>
2026-06-08 12:19:22 +00:00
Miss Islington (bot)
6e5c4c0c52
[3.13] Docs: Fix missing colon in bisect example function (GH-151061) (GH-151069)
Docs: Fix missing colon in `bisect` example function (GH-151061)
(cherry picked from commit 16ede813eb)

Co-authored-by: Sergio López Gómez <sergiolopezgmz.dam@gmail.com>
2026-06-08 09:45:49 +00:00
Miss Islington (bot)
5ca5a0af2c
[3.13] Update an error message in the 'Functional Programming HOWTO' (GH-151047)
(cherry picked from commit 81965c1683)

Co-authored-by: saber-bit <bryanventura0324@gmail.com>
2026-06-07 18:26:30 +01:00
Miss Islington (bot)
8a69d89600
[3.13] Delete mention encoding and errors for importlib.resources.path() (GH-143111) (GH-151016)
(cherry picked from commit fded34d6fe)

Co-authored-by: Alexander Shadchin <shadchin@yandex-team.com>
2026-06-06 11:58:49 +00:00
Miss Islington (bot)
b9ea60c38e
[3.13] Use time.monotonic in OrderedDict LRU cache example (GH-150986) (#150993)
Use `time.monotonic` in OrderedDict LRU cache example (GH-150986)
(cherry picked from commit ea4c85552b)

Co-authored-by: Ilya Nikolaev <65247719+ilya-nikolaev@users.noreply.github.com>
2026-06-06 01:59:53 +03:00
Miss Islington (bot)
0918ad4b0f
[3.13] gh-129011: Update docs for Raw I/O read, readinto, and write (GH-135328) (#150959)
gh-129011: Update docs for Raw I/O read, readinto, and write (GH-135328)

Update `RawIOBase` and `FileIO` documentation to match implementation
behavior around `.read`, `.readinto`, `.readall` and `.write`.

In particular:

 - They may make more than one system call (PEP-475)
 - Add warnings if `.write()` requires a wrapping retry loop (see: gh-126606)
    - "Raw I/O" `.write`` may not write all bytes
    - `buffering=0` example results in a "Raw I/O"
(cherry picked from commit e4db68b9c9)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-05 12:07:39 +00:00
Miss Islington (bot)
d7beb9c06d
[3.13] gh-106318: Add doctest role and a 'See also' to the str.split() docs (GH-144367)
(cherry picked from commit a96cba5c4a)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2026-06-04 14:23:07 +01:00
Miss Islington (bot)
a6f3b6144d
[3.13] Correct Stable ABI documentation for METH_FASTCALL (GH-149593) (GH-150851)
The current documentation says:

>
> METH_FASTCALL
>    Part of the Stable ABI since version 3.7.
>
> [...]
>
>   Added in version 3.7.
>
>    Changed in version 3.10: METH_FASTCALL is now part of the stable ABI.

so is contradictory about when it was added to the Stable ABI.  Looking at the header it seems like 3.10 is right.
(cherry picked from commit 58beae7319)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
2026-06-04 11:50:19 +02:00
Miss Islington (bot)
64b982071b
[3.13] gh-140553: Mark *gettext parameters as positionaly only in documentation (GH-140598)
(cherry picked from commit 1837c17bc7)

Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-04 09:19:56 +01:00
Hugo van Kemenade
26e3ca4160
[3.13] Docs: Replace hardcoded SOURCE_URI with patchlevel check (GH-150850) (#150857) 2026-06-03 16:50:07 +03:00
Miss Islington (bot)
d229764d1e
[3.13] Fix a typo in SSLSocket docs (GH-150839) (GH-150847)
Fix a typo in `SSLSocket` docs (GH-150839)
(cherry picked from commit 5553e003ca)

Co-authored-by: Robsdedude <dev@rouvenbauer.de>
2026-06-03 12:26:03 +00:00
Alex Waygood
7c5734c791
[3.13] gh-150319: Replace all documentation which says "See PEP 585" (#150325) (#150814)
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



* Correct several class getitem docs

And expand the text for tuples.



* 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



* Apply suggestions from code review

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



* Update Doc/library/re.rst



* Update Objects/enumobject.c



* 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



* 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.



* 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



* 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: Stephen Rosen <sirosen@globus.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Jelle Zijlstra <906600+JelleZijlstra@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-06-02 22:26:33 +00:00
Miss Islington (bot)
d3bfccdbd5
[3.13] gh-141627: Fix BufferedRandom inheritance documentation (GH-141629) (GH-150803)
BufferedRandom does not inherit from BufferedReader and BufferedWriter
in the C implementation.
(cherry picked from commit 551bc2cb5e)

Co-authored-by: Mohsin Mehmood <55545648+mohsinm-dev@users.noreply.github.com>
2026-06-02 22:22:45 +03:00
Miss Islington (bot)
590d8c95b5
[3.13] Fix description of the function parameter of shutil.register_archive_format() (GH-145087) (GH-150806)
(cherry picked from commit 18c6d3ccc3)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2026-06-02 19:20:16 +00:00
Victor Stinner
13d8f452a1
[3.13] gh-89554: Document _thread.LockType as a class (#150684) (#150786)
gh-89554: Document _thread.LockType as a class (#150684)

_thread.LockType is a class (the type of lock objects), but was documented
with the ".. data::" directive, so ":class:" cross-references to it cannot
resolve against a py:class target.

Switch the entry to ".. class::", move it next to the lock methods, and
document acquire(), release() and locked() as methods of the class.  Keep
the old _thread.lock.* URL fragments working with raw HTML anchors.

(cherry picked from commit e37ce56977)

Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
2026-06-02 15:13:35 +02:00
Victor Stinner
b8ce8a38d1
[3.13] gh-149738: Fix segmentation fault bug in sqllite3 (#149754) (#150770)
gh-149738: Fix segmentation fault bug in sqllite3 (#149754)

Deleting the `row_factory` or `text_factory` attribute is no longer allowed.

(cherry picked from commit 60fdb3192b)

Co-authored-by: Sepehr Rasouli <sepehrrasouli06@gmail.com>
2026-06-02 14:52:30 +02:00
Manoj K M
3db8872021
[3.13] Fix a typo in 'Exception Handling' C-API documentation (GH-150674)
(cherry picked from commit cee3327b92)
2026-06-02 12:28:12 +01:00
Miss Islington (bot)
7d1998d2d5
[3.13] gh-123138: Updated email.headerregistry docs to include required keyword parse_tree (GH-134450) (GH-150625)
(cherry picked from commit 2c20f9ce17)

Co-authored-by: Gustaf <79180496+gostak-dd@users.noreply.github.com>
2026-06-02 09:26:18 +00:00
Miss Islington (bot)
17bb3eac52
[3.13] gh-89554: Document typing.ParamSpecArgs and ParamSpecKwargs as classes (GH-150677) (GH-150765)
Use the directive "class" instead of "data" for ParamSpecArgs and ParamSpecKwargs.
(cherry picked from commit 35c314d2b7)

Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
2026-06-02 08:14:43 +00:00
Miss Islington (bot)
8b9997d82c
[3.13] gh-89554: Document weakref type objects as classes (GH-150678) (GH-150758)
Use the "class" directive instead of "data" for ReferenceType,
ProxyType and CallableProxyType.
(cherry picked from commit 10c421970b)

Co-authored-by: Bernát Gábor <gaborjbernat@gmail.com>
2026-06-02 08:06:04 +00:00