Commit Graph

28215 Commits

Author SHA1 Message Date
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
Tian Gao 3dfa364cf2
gh-119580: Improve version added section for convenience variable (#119583) 2024-05-27 17:54:23 +00:00
Hugo van Kemenade 88e3fee3f8
Docs: Only install sphinx-autobuild for `make htmllive` (#119607) 2024-05-27 11:29:27 -06:00
Rafael Fontenelle 59630f92d8
Docs: Add class role for IPV{4,6}Address and fix a typo (#118059)
Add class role for IPV{4,6}Address and fix a typo

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-05-27 12:39:59 +00:00
Savannah Ostrowski 041a566f3f
GH-117283: Add doc warning for `PyTuple_SetItem` refcount > 1 (#117916) 2024-05-27 17:50:28 +05:30
Aditya Borikar 3b26cd8ca0
gh-119467: Fix Py_buffer.format type and correct documentation typo (#119475) 2024-05-27 17:46:13 +05:30
Alex Waygood 008bc04dcb
gh-119562: Remove AST nodes deprecated since Python 3.8 (#119563) 2024-05-26 12:34:48 +00:00
Wulian233 b5b7dc98c9
Update README and layout.html from 3.13 to 3.14 (#119539)
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-05-26 11:26:59 +00:00
Ned Batchelder d25954dff5
docs: fix a few typos identified by codespell (#119516) 2024-05-25 18:13:31 -07:00
Barney Gale e418fc3a6e
GH-82805: Fix handling of single-dot file extensions in pathlib (#118952)
pathlib now treats "`.`" as a valid file extension (suffix). This brings
it in line with `os.path.splitext()`.

In the (private) pathlib ABCs, we add a new `ParserBase.splitext()` method
that splits a path into a `(root, ext)` pair, like `os.path.splitext()`.
This method is called by `PurePathBase.stem`, `suffix`, etc. In a future
version of pathlib, we might make these base classes public, and so users
will be able to define their own `splitext()` method to control file
extension splitting.

In `pathlib.PurePath` we add optimised `stem`, `suffix` and `suffixes`
properties that don't use `splitext()`, which avoids computing the path
base name twice.
2024-05-25 21:01:36 +01:00
Hugo van Kemenade a531fd7fdb
FAQ: Add reference to Python version numbering scheme (#119225) 2024-05-25 08:13:17 -06:00
Serhiy Storchaka 08e65430aa
gh-111999: Fix the signature of str.format_map() (#119540) 2024-05-25 06:21:11 -07:00
Raymond Hettinger 49c3ade4f3
Misc improvement to the docs for itertools (gh-119529) 2024-05-24 16:58:24 -05:00
Barney Gale 81d6336230
GH-119054: Add "Querying file type and status" section to pathlib docs (#119055)
Add a dedicated subsection for `Path.stat()`-related methods, specifically
`stat()`, `lstat()`, `exists()`, `is_*()`, and `samefile()`.
2024-05-24 19:35:13 +00:00
Kirill Podoprigora 045e195c76
Regen ``Doc/requirements-oldest-sphinx.txt`` (#119520) 2024-05-24 13:30:32 -06:00