Commit graph

28229 commits

Author SHA1 Message Date
Erlend E. Aasland 225aab7f70
gh-110383: Improve 'old string formatting' text in tutorial (#120219) 2024-06-07 15:37:18 +02:00
Aditya Borikar 6646a9da26
gh-110383: Clarify "non-integral" wording in pow() docs (#119688) 2024-06-07 11:44:42 +02:00
Hugo van Kemenade 5c115567b1
Add Plausible for docs metrics (#119977)
Co-authored-by: Julien Palard <julien@palard.fr>
2024-06-07 00:38:31 -06:00
Jacob Walls 6b606522ca
gh-119577: Adjust DeprecationWarning when testing element truth values in ElementTree (GH-119762)
Adjust DeprecationWarning when testing element truth values in ElementTree, we're planning to go with the more natural True return rather than a disruptive harder to code around exception raise, and are deferring the behavior change for a few more releases.
2024-06-06 20:18:30 -07:00
Barney Gale 14e1506a6d
GH-119054: Add "Reading directories" section to pathlib docs (#119956)
Add a dedicated subsection for `Path.iterdir()`-related methods,
specifically `iterdir()`, `glob()`, `rglob()` and `walk()`.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-06-06 23:27:39 +00:00
David Lowry-Duda 5bdc87b885
gh-120178: Documentation typo corrections (#120179) 2024-06-06 14:35:24 -07:00
Jan Kaliszewski f878d46e56
gh-120128: fix description of argument to ipaddress.collapse_addresses() (#120131)
The argument to collapse_addresses() is now described as an *iterable*
(rather than *iterator*).
2024-06-06 00:52:40 +03:00
Irit Katriel 5c02ea8bae
gh-119287: clarify doc on BaseExceptionGroup.derive and link to it from contextlib.suppress (#119657) 2024-06-05 11:56:01 +00:00
shurj0 b6b0dcbfc0
gh-120078: Fix struct_time attr typo tm_day -> tm_mday in Doc/library/time.rst (GH-120081) 2024-06-04 19:23:12 -05:00
Irit Katriel 770f3c1ead
gh-114616: Improve docs regarding changes to caches representation in dis (#120033) 2024-06-04 23:00:02 +00:00
Paulo Freitas bf5e1065f4
doc: Mention the missing reflected special methods for all binary operations (GH-119931) 2024-06-04 17:55:11 +00:00
Trey Hunner 5f03f09134
Fix incorrect pull GitHub link in What's New (#120045)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-04 16:28:08 +00:00
Jason R. Coombs 4dcd91ceaf
gh-119588: Update docs to reflect decision to include the change with Python 3.13 and not 3.12. (#120043) 2024-06-04 15:20:01 +00:00
Bénédikt Tran ff1857d6ed
gh-120029: export DEF_TYPE_PARAM compiler flag (#120028) 2024-06-04 07:24:22 -07:00
Nikita Sobolev 1d4c2e4a87
gh-119057: Use better error messages for zero division (#119066) 2024-06-03 19:03:56 +03:00
Jason R. Coombs 42a34ddb0b
gh-119588: Implement zipfile.Path.is_symlink (zipp 3.19.0). (#119591) 2024-06-03 11:13:07 -04:00
Sergey B Kirpichev 61d3ab32da
gh-116560: Add PyLong_GetSign() public function (#116561)
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-06-03 14:06:31 +02:00
Awbert cae4c80714
gh-119968: Improved monitoring c-api docs (#119969) 2024-06-03 12:31:02 +03:00
Nikita Sobolev 84c3191954
gh-118827: Remove Quoter from urllib.parse (#118828)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-03 10:50:29 +03:00
Solomon Himelbloom 117a8acdab
gh-109975: What's New in Python 3.13: fix broken link for telnetlib alternative (#119958) 2024-06-02 17:43:03 -07:00
Barney Gale bd6d4ed645
GH-119054: Add "Reading and writing files" section to pathlib docs (#119524)
Add a dedicated subsection for `open()`, `read_text()`, `read_bytes()`,
`write_text()` and `write_bytes()`.
2024-06-02 19:39:19 +00:00
Jelle Zijlstra aa9fe98e06
Improve documentation for typing.get_type_hints (#119928)
- Explicit list of what it does that is different from
  "just return __annotations__"
- Remove reference to PEP 563; adding the future import doesn't
  do anything to type aliases, and in general it will never make
  get_type_hints() less likely to fail.
- Remove example, as the Annotated docs already have a similar
  example, and it's unbalanced to have one example about this
  one edge case but not about other behaviors of the function.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-02 08:13:24 -07:00
Mark Dickinson f79ffc879b
gh-119740: Remove deprecated trunc delegation (#119743)
Remove the delegation of `int` to the `__trunc__` special method: `int` will now only delegate to `__int__` and `__index__` (in that order). `__trunc__` continues to exist, but its sole purpose is to support `math.trunc`.

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-02 10:16:49 +01:00
Nikita Sobolev 4aed319a8e
gh-119775: Remove ability to create immutable types with mutable bases (#119776) 2024-06-02 07:27:20 +00:00
Alyssa Coghlan fd6cd621e0
gh-118934: Fix PyEval_GetLocals docs (PEP 667) (#119932)
PEP 667's description of the planned changes to PyEval_GetLocals
was internally inconsistent when accepted, so the docs added for
gh-74929 didn't match either the current behaviour or the intended
behaviour once gh-118934 is fixed.

This PR updates the documentation and 3.13 What's New to match the
intended behaviour (once gh-118934 is fixed).

It also tidies up lingering references to `f_locals` always being a
dictionary (this hasn't been true since at least when custom
namespace support for class statement execution was added)
2024-06-02 04:44:29 +00:00
Nice Zombies c618f7d80e
gh-119016: Remove outdated sentences from the "classes" tutorial (#119130)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-01 21:20:00 +00:00
Raymond Hettinger 63111bfcf0
Add unique() recipe to itertools docs (gh-119911) 2024-06-01 11:30:24 -05:00
Alyssa Coghlan 2180991ea3
gh-118888: Further PEP 667 docs updates (gh-119893)
* Clarify impact on default behaviour of exec, eval, etc
* Update documentation for changes to PyEval_GetLocals (gh-74929)

Closes gh-11888
2024-06-01 16:21:48 +10:00
Alyssa Coghlan 3859e09e3d
gh-74929: PEP 667 C API documentation (gh-119379)
* Add docs for new APIs
* Add soft-deprecation notices
* Add What's New porting entries
* Update comments referencing `PyFrame_LocalsToFast()` to mention the proxy instead
* Other related cleanups found when looking for refs to the deprecated APIs
2024-06-01 13:59:35 +10:00
Sam Gross 9bc6045842
doc: Add glossary entry for "free threading" (#119865) 2024-05-31 13:23:29 -04:00
Zachary Ware f3fc800d5f
contextlib docs: Clean up redundant 'up' after 'cleanup' (GH-119867)
Reported by Michael Kass on docs@
2024-05-31 17:19:54 +00:00
Irit Katriel 015b1fdd0a
gh-100117: Fix inaccuracy in documentation of the CodeObject's co_positions field. (#119364) 2024-05-31 17:09:48 +00:00
Dino Viehland 0d07182821
gh-111201: Support pyrepl on Windows (#119559)
Co-authored-by: Anthony Shaw <anthony.p.shaw@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-31 09:49:03 +02:00
Serhiy Storchaka ef01e95ae3
gh-109218: Deprecate weird cases in the complex() constructor (GH-119620)
* Passing a string as the "real" keyword argument is now an error;
  it should only be passed as a single positional argument.
* Passing a complex number as the "real" or "imag" argument is now deprecated;
  it should only be passed as a single positional argument.
2024-05-30 23:30:57 +03:00
Hugo van Kemenade deda85717b
Docs: shutil.rmtree's onerror has no pending removal version (#118947) 2024-05-30 14:26:46 -06:00
Serhiy Storchaka ec1ba26460
gh-109218: Improve documentation for the complex() constructor (GH-119687)
* Remove the equivalence with real+imag*1j which can be incorrect in corner
  cases (non-finite numbers, the sign of zeroes).
* Separately document the three roles of the constructor: parsing a string,
  converting a number, and constructing a complex from components.
* Document positional-only parameters of complex(), float(), int() and bool()
  as positional-only.
* Add examples for complex() and int().
* Specify the grammar of the string for complex().
* Improve the grammar of the string for float().
* Describe more explicitly the behavior when real and/or imag arguments are
  complex numbers. (This will be deprecated in future.)
2024-05-30 20:20:07 +00:00
Sam Gross 1c04c63ced
gh-119729: Use 't' in pkg-config file name for free-threaded build (#119738)
For example, the free-threaded build now generates
`lib/pkgconfig/python-3.13t.pc` and the debug build generates
`lib/pkgconfig/python-3.13d.pc`.
2024-05-30 13:48:28 -04:00
Awbert 6fb191be15
gh-119779: Fix pyporting howto docs (#119785) 2024-05-30 18:51:22 +03:00
Bradley Reynolds b1374aa1c2
gh-110383: Remove references to removed popen[234] (GH-112783)
Signed-off-by: Bradley Reynolds <bradley.reynolds@darbia.dev>
2024-05-30 12:21:37 +00:00
Lincoln db009348b4
gh-118055: Update the finder glossary entry (GH-118278) 2024-05-30 08:51:23 +00:00
Petr Viktorin 48f21b3631
gh-118235: Move RAISE_SYNTAX_ERROR actions to invalid rules and make sure they stay there (GH-119731)
The Full Grammar specification in the docs omits rule actions, so grammar rules that raise a syntax error looked like valid syntax.
This was solved in ef940de by hiding those rules in the custom syntax highlighter.

This moves all syntax-error alternatives to invalid rules, adds a validator that ensures that actions containing RAISE_SYNTAX_ERROR are in invalid rules, and reverts the syntax highlighter hack.
2024-05-30 09:27:32 +02:00
Zachary Ware 2cc3502f98
subprocess docs: Fix semantically important typo (GH-119752)
GH-25416 accidentally replaced a reference to the *stderr* argument of
`subprocess.run` with a reference to the *stdin* argument.  *stdin* is
not affected by the `check_output` option.
2024-05-29 22:19:54 +00:00
Aditya Borikar bf4ff3ad2e
gh-119260: Clarify is_dataclass Behavior for Subclasses in Documentation and Tests (#119480)
Co-authored-by: Carl Meyer <carl@oddbird.net>
2024-05-29 17:26:22 +00:00
Hugo van Kemenade 0751511d24
gh-93963: Remove deprecated names from importlib.abc (#119720)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-05-29 11:08:27 -06:00
Sergey B Kirpichev 0cdc5c8d54
gh-119613: Soft deprecate Py_IS_NAN/INFINITY/FINITE (#119701)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-05-29 10:45:14 +00:00
Matthias Görgens 18c1a8d3a8
gh-97588: Align ctypes struct layout to GCC/MSVC (GH-97702)
Structure layout, and especially bitfields, sometimes resulted in clearly
wrong behaviour like overlapping fields. This fixes

Co-authored-by: Gregory P. Smith <gps@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-05-29 12:02:53 +02:00
Nikita Sobolev f912e5a2f6
gh-118824: Remove deprecated master_open and slave_open from pty (#118826)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-05-28 16:42:35 +03:00
Justin Kunimune b407ad38fb
[doc] Clarify the nature of the root logger in the logging documentation (GH-119440)
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
2024-05-28 11:31:20 +01:00
Raymond Hettinger 0bd0d4072a
Misc cleanups and wording improvements for the itertools docs (gh-119626) 2024-05-27 13:22:57 -05:00
Hugo van Kemenade eea26c4a73
Docs: Move inline JavaScript to own file to reduce duplication (#119541) 2024-05-27 18:04:34 +00:00