Commit graph

31072 commits

Author SHA1 Message Date
Danny Lin
aec0aed197
gh-51067: Add remove() and repack() to ZipFile (GH-134627)
The docs included in the commit do the best job of describing this.

Much discussion on the PR and issue.

thank you to to core team folks jaraco, emmatyping, gpshead, and all others who added their constructive comments along the way.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2026-06-20 12:45:53 -07:00
Serhiy Storchaka
88e5d8a7b7
gh-151675: Add tkinter Text.sync() and Text.pendingsync() (GH-151677)
Wrap the Tk text widget "sync" and "pendingsync" subcommands, which
control and report the synchronization of the displayed view with the
underlying text when line heights have not yet been computed.
2026-06-20 17:11:21 +03:00
Serhiy Storchaka
aa5b164577
gh-151674: Add tkinter Text.edit_canundo() and Text.edit_canredo() (GH-151676)
Wrap the Tk text widget "edit canundo" and "edit canredo" subcommands,
which report whether the undo and redo stacks are non-empty.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 09:39:09 +03:00
Serhiy Storchaka
2e5843e13f
gh-151744: Add curses.nofilter() (GH-151747)
Wrap the ncurses nofilter() function, which undoes the effect of
filter().  Without it there is no way to restore normal screen sizing
after a curses.filter() call in the same process.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 17:49:26 +00:00
Duprat
da69fcf98d
gh-151427: add 'not macOS' and 'not iOS' restrictions on availability state of some functions in os module. (#151537) 2026-06-19 04:08:53 -04:00
Cody Maloney
9688d252d3
gh-101100: Document os.uname_result and os.statvfs_result with related constants (GH-151301) 2026-06-19 09:50:22 +03:00
mushitoriami
15d74068f3
docs: Fix broken reference of parameter type in library/logging.rst (GH-151645) 2026-06-18 18:45:04 +01:00
Harjoth Khara
e99b319682
gh-146353: Document PyBytesWriter_GetData pointer validity (GH-151418) 2026-06-18 12:55:06 -04:00
Serhiy Storchaka
bfecfcc2a8
gh-86726: Add few missing versionadded directives (GH-151662)
Pack.pack_content, Place.place_content and Grid.grid_content were
added in 3.15.
2026-06-18 15:46:57 +00:00
Serhiy Storchaka
3cd02a1c2d
gh-86726: Fix the documented return type of tkinter info_patchlevel() (GH-151655)
It returns a sys.version_info-like named tuple, not a string.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 17:34:57 +03:00
Serhiy Storchaka
d47c27e47a
gh-86726: Fix "deprecated" directive for wm_attributes (GH-151652) 2026-06-18 16:26:58 +03:00
da-woods
fd53ae1139
gh-141510 Document and test frozendict class matching behaviour (#150799)
Frozendict has `_Py_TPFLAGS_MATCH_SELF` set so works correctly
with the single-arg class matching. However it isn't documented
in the list of classes this works with and it isn't tested.

The test is some way below the other similar tests but anything
else would need a large renumbering.
2026-06-18 14:53:09 +02:00
Serhiy Storchaka
8b270b72a2
gh-86726: Document the full public API of tkinter (GH-151579)
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.

--------

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 15:39:06 +03:00
Serhiy Storchaka
12add3822f
gh-151623: Add missing curses docstrings and document intrflush() (#151632) 2026-06-18 13:52:26 +03:00
Hugo van Kemenade
f551705011
gh-151623: Improve curses documentation style (#151635) 2026-06-18 12:43:33 +03:00
Serhiy Storchaka
65afcdd8df
gh-151623: Improve curses documentation and docstrings (GH-151625)
Fix errors and clarify the curses, curses.panel and curses.ascii docs
against X/Open Curses and ncurses, and sync the affected docstrings.
2026-06-18 11:20:03 +03:00
mushitoriami
3a03405e0f
docs: Fix indent misalignment in library/logging.config.rst (GH-151617) 2026-06-18 08:21:24 +01:00
Petr Viktorin
16185e9fe2
gh-149044: Improve Py_tp_base[s] docs & error message for non-type bases (GH-151252)
The initial implementation of PEP 820 worsened the error message
when non-types are given as base types in Py_tp_bases & Py_tp_base.
Bring back the 'bases must be types' wording and add a 'got' note for
easier debugging.

Improve slot ID documentation, and soft-deprecate Py_tp_base
(as per the PEP).
2026-06-17 15:27:02 +02:00
Victor Stinner
b16d23fc9f
gh-151218: Replace sys.flags in PyConfig_Set() (#151402)
PyConfig_Set() and sys.set_int_max_str_digits() now replace
sys.flags (create a new object), instead of modifying sys.flags in-place.

Modifying sys.flags in-place can lead to data races when multiple
threads are reading or writing sys.flags in parallel.

Use _Py_atomic functions to get and set max_str_digits members.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-06-16 16:17:33 +00:00
Xiao Yuan
46107ad9da
gh-92455: Respect case-sensitive mimetype suffixes (GH-148782) 2026-06-15 15:05:29 +00:00
Aniket
47b7dc788c
gh-139837: Document attributes of objects recorded by warnings.catch_warnings (GH-139893)
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-14 15:39:33 +03:00
Shardul Deshpande
9ad6ba0324
gh-151443: Fix documented default of unittest.mock.mock_open's read_data parameter (#151444) 2026-06-13 18:31:03 +00:00
Jonathan Dung
5b38519762
Docs: Fix method directive signatures in enum docs (#151429) 2026-06-13 09:47:23 +01:00
Rafael Fontenelle
f4f102027a
Fix typos in the curses.ascii module documentation (#129300)
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-12 16:02:33 +00:00
Maciej Olko
d986124d83
Docs: avoid repetitions of class references in functions.rst (#150891) 2026-06-12 17:53:06 +03:00
Aniket
402668b2b1
gh-138991: Update dataclass documentation for new eq behavior in Python 3.13 (#139007)
And add tests.

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-11 17:15:29 +00:00
Cody Maloney
b18168cb32
gh-101100: Fix Sphinx nitpick in unittest.mock.rst (#151302) 2026-06-11 16:29:40 +01:00
Maciej Olko
b9bffc09a6
gh-139588: Fix nondeterministic make latex doc build under parallel make (#151343) 2026-06-11 16:13:22 +01:00
Stan Ulbrych
9620f69cd4
Drop historical :author:s from HOWTOs (#151091) 2026-06-11 09:46:39 +01:00
glennglazer
84630e2cb9
gh-136880: Add warning about PYTHONPATH (GH-151098) 2026-06-11 07:14:34 +01:00
Petr Viktorin
7bbb9607a2
gh-141984: Reword the Generator expressions section (GH-150518)
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-10 16:45:30 +02:00
Kumar Aditya
e2bd50d2e1
add asyncio guide for Free-Threaded Python (#150456) 2026-06-10 14:02:11 +00:00
Manoj K M
8c0e2515bb
Docs: Fix typos in the "Memory Management" section (GH-151243) 2026-06-10 09:13:17 -04:00
Bernát Gábor
a621e8ad81
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.
2026-06-10 15:01:01 +02:00
sobolevn
44a533fa1b
gh-150671: Deprecate PyAsyncGen_New, PyCoro_New, PyGen_New, PyGen_NewWithQualName functions (#150672)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-10 15:57:09 +03:00
Serhiy Storchaka
ca32ebf793
gh-80384: Check that callback is callable at weak reference creation (GH-151145)
* Python functions weakref.ref() and weakref.proxy() now raise TypeError
  if the callback argument is not callable or None.
* C functions PyWeakref_NewRef() and PyWeakref_NewProxy() now raise TypeError
  if the callback argument is not callable, None, or NULL.

Co-authored-by: Maxwell Bernstein <emacs@fb.com>
2026-06-10 13:34:55 +03:00
Taeknology
11c93d6df3
gh-149716: Document PySlot_DATA for Py_mod_gil and Py_mod_multiple_interpreters (GH-150053)
Add short code examples mirroring the existing Py_mod_abi example,
so it is clear which slot definition macro (PySlot_DATA, PySlot_INT64,
or PySlot_UINT64) to use for these two slots.
2026-06-10 12:10:15 +02:00
Savannah Ostrowski
82cb7d4bf6
GH-59633: Clarify dest collisions in argparse docs (#150987) 2026-06-09 10:07:03 -07:00
Savannah Ostrowski
bc37a227b2
GH-61082: Clarify nargs='*' positional default behavior (#150989) 2026-06-09 15:37:24 +00:00
Savannah Ostrowski
528550e0e7
GH-54732: Tweak wording around empty lines in argument files (#150980) 2026-06-09 15:37:15 +00:00
Sergio López Gómez
3266edefd7
Docs: add cross-references to improve navigation in getpass.rst (#151092) 2026-06-09 11:36:05 -04:00
Robsdedude
b2e2cd3912
gh-150898: Assume OpenSSL supports keylogging (#150870)
Since version 3.10, CPython requires OpenSSL 1.1.1 or higher.
Therefore, support for keylogging can be assumed.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2026-06-09 16:37:38 +02:00
Stan Ulbrych
0a179e748b
Docs: Only add profiling-sampling-visualization.{css,js} to files when necessary (#151150) 2026-06-09 14:16:03 +01:00
Arshal Aromal
29a920e80e
gh-151070: Fix class referencing typo in collections.abc docs (GH-151088) 2026-06-08 22:38:14 +03:00
Eduardo Villalpando Mello
5c13217314
gh-148932: Fix profiling.sampling on Windows virtual environments (#150541) 2026-06-08 17:25:43 +00:00
Adorilson Bezerra
f051c68923
gh-106318: Add examples to the str.isdigit() method docs (#144721)
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-06-08 12:51:35 +00:00
Doron Behar
bd5fa31c5f
gh-141623: operator.rst: don't use term "bitwise" (GH-141846) 2026-06-08 15:12:48 +03:00
Jonathan Dung
e3762114e5
Mention frozendict in object.__hash__() documentation (#148867) 2026-06-08 12:39:41 +01:00
Christian Zinck
a1873300ee
gh-101100: Fix Sphinx warnings in 'Buffer Object Structures' documentation (#151058) 2026-06-08 11:24:26 +01:00
Sergio López Gómez
16ede813eb
Docs: Fix missing colon in bisect example function (GH-151061) 2026-06-08 05:39:03 -04:00