Commit Graph

28359 Commits

Author SHA1 Message Date
Miss Islington (bot) 1b028117d1
[3.13] gh-120496: Add a note about iterator thread-safe (gh-120685) (#120706)
gh-120496: Add a note about iterator thread-safe (gh-120685)
(cherry picked from commit 7e189aed64)

Co-authored-by: Donghee Na <donghee.na@python.org>
2024-06-19 13:15:44 +09:00
Miss Islington (bot) 1ce5984961
[3.13] gh-118789: Add `PyUnstable_Object_ClearWeakRefsNoCallbacks` (GH-118807) (#120695)
This exposes `PyUnstable_Object_ClearWeakRefsNoCallbacks` as an unstable
C-API function to provide a thread-safe mechanism for clearing weakrefs
without executing callbacks.

Some C-API extensions need to clear weakrefs without calling callbacks,
such as after running finalizers like we do in subtype_dealloc.
Previously they could use `_PyWeakref_ClearRef` on each weakref, but
that's not thread-safe in the free-threaded build.

(cherry picked from commit e8752d7b80)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-06-18 14:54:51 +00:00
Miss Islington (bot) 8c129d99ef
[3.13] gh-119241: Add HOWTO for free-threaded C API extensions (GH-119877) (#120693)
Some sections adapted from https://github.com/Quansight-Labs/free-threaded-compatibility/
written by Nathan Goldbaum.

(cherry picked from commit 02b272b702)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
2024-06-18 14:28:51 +00:00
Miss Islington (bot) 36b0052cb2
[3.13] gh-120662: Improve `smtplib` example (GH-120668) (#120681)
gh-120662: Improve `smtplib` example (GH-120668)
(cherry picked from commit 4bc27abdbe)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-18 12:12:58 +00:00
Jelle Zijlstra 7c47f93dff
[3.13] gh-119933: Improve ``SyntaxError`` message for invalid type parameters expressions (GH-119976) (#120641)
(cherry picked from commit 4bf17c381f)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-06-17 08:01:49 -07:00
Miss Islington (bot) 3b28e430ed
[3.13] gh-112346: Document the OS byte in `gzip.compress` output change in 3.11 (GH-120480) (#120612)
gh-112346: Document the OS byte in `gzip.compress` output change in 3.11 (GH-120480)
(cherry picked from commit bac4edad69)


gh-112346: Describe the "os" byte in gzip output change.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-06-17 06:06:11 +00:00
Miss Islington (bot) 7655989a3a
[3.13] gh-118596: Add thread-safety clarifications to the SSLContext documentation (GH-118597) (#120595)
gh-118596: Add thread-safety clarifications to the SSLContext documentation (GH-118597)

Add thread-safety clarifications to the SSLContext documentation. Per the issue:

This issue has also come up [here](https://github.com/psf/requests/pull/6667) where the matter was clarified by @tiran in [this comment](https://github.com/psf/requests/pull/6667):
> `SSLContext` is designed to be shared and used for multiple connections. It is thread safe as long as you don't reconfigure it once it is used by a connection. Adding new certs to the internal trust store is fine, but changing ciphers, verification settings, or mTLS certs can lead to surprising behavior. The problem is unrelated to threads and can even occur in a single-threaded program.
(cherry picked from commit 4f59f86382)

Co-authored-by: mm-matthias <43849132+mm-matthias@users.noreply.github.com>
2024-06-16 20:43:20 +00:00
Miss Islington (bot) 96b784b61f
[3.13] Docs: remove temporary hardcoded links (GH-120348) (#120587)
Docs: remove temporary hardcoded links (GH-120348)
(cherry picked from commit b8484c6ad7)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-16 13:07:27 +00:00
Miss Islington (bot) d4e1d093d8
[3.13] gh-120572: add missing parentheses in TypeIs documentation (GH-120573) (#120575)
gh-120572: add missing parentheses in TypeIs documentation (GH-120573)
(cherry picked from commit 1fa595963e)

Co-authored-by: Nyuan Zhang <blueglassblock@outlook.com>
2024-06-16 05:51:29 +00:00
Miss Islington (bot) a19bb261a3
[3.13] gh-112346: Always set OS byte to 255, simpler gzip.compress function. (GH-120486) (#120563)
gh-112346: Always set OS byte to 255, simpler gzip.compress function. (GH-120486)

This matches the output behavior in 3.10 and earlier; the optimization in 3.11 allowed the zlib library's "os" value to be filled in instead in the circumstance when mtime was 0.  this keeps things consistent.
(cherry picked from commit 08d09cf5ba)

Co-authored-by: Ruben Vorderman <r.h.p.vorderman@lumc.nl>
2024-06-15 19:10:50 +00:00
Miss Islington (bot) 29bbd5f8e4
[3.13] annotations: expand documentation on "simple" assignment targets (GH-120535) (#120555)
This behavior is rather surprising and it was not clearly specified.

(cherry picked from commit 9e0b11eb21)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-15 15:35:57 +00:00
Miss Islington (bot) da40fa3526
[3.13] gh-120361: Add `nonmember` test with enum flags inside to `test_enum` (GH-120364) (#120511)
gh-120361: Add `nonmember` test with enum flags inside to `test_enum` (GH-120364)

* gh-120361: Add `nonmember` test with enum flags inside to `test_enum`
(cherry picked from commit 7fadfd82eb)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-06-14 22:08:21 +03:00
Miss Islington (bot) d5ad3b7fc8
[3.13] GH-119054: Add "Renaming and deleting" section to pathlib docs. (GH-120465) (#120472)
GH-119054: Add "Renaming and deleting" section to pathlib docs. (GH-120465)

Add dedicated subsection for `pathlib.Path.rename()`, `replace()`,
`unlink()` and `rmdir()`.
(cherry picked from commit d88a1f2e15)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2024-06-13 20:43:59 +00:00
Miss Islington (bot) e0f4dd8ec5
[3.13] GH-119054: Add "Creating files and directories" section to pathlib docs. (GH-120186) (#120462)
GH-119054: Add "Creating files and directories" section to pathlib docs. (GH-120186)

Add dedicated subsection for `pathlib.Path.touch()`, `mkdir()`,
`symlink_to()` and `hardlink_to()`. Also note that `open()`, `write_text()`
and `write_bytes()` are often used to create files.

(cherry picked from commit c2d810b6d4)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-13 18:17:57 +00:00
Miss Islington (bot) b1ebbb5d65
[3.13] gh-101575: document Decimal.__round__() (GH-101737) (GH-120394)
gh-101575: document Decimal.__round__() (GH-101737)
(cherry picked from commit 7dd8c37a06)

Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
2024-06-13 09:07:37 +02:00
Miss Islington (bot) f0788cb419
[3.13] gh-120345: Fix incorrect use of the :class: role with the "()" suffix (GH-120347) (GH-120411)
* Remove "()" when refer to a class as a type.
* Use :func: when refer to a callable.
* Fix reference to the datetime.astimezone() method.
(cherry picked from commit 92c9c6ae14)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-12 14:51:35 +00:00
Miss Islington (bot) 8f5ce42f34
[3.13] gh-120128: fix description of argument to ipaddress.collapse_addresses() (GH-120131) (#120135)
gh-120128: fix description of argument to ipaddress.collapse_addresses() (GH-120131)

The argument to collapse_addresses() is now described as an *iterable*
(rather than *iterator*).
(cherry picked from commit f878d46e56)

Co-authored-by: Jan Kaliszewski <zuo@kaliszewski.net>
2024-06-12 09:23:24 +03:00
Miss Islington (bot) f465dfbdbc
[3.13] Fix typo in ElementTree docs (GH-120342) (#120357)
Fix typo in ElementTree docs (GH-120342)
(cherry picked from commit 0335662fe1)

Co-authored-by: naglis <827324+naglis@users.noreply.github.com>
2024-06-11 17:24:29 +00:00
Miss Islington (bot) f6689d91b2
[3.13] gh-120276: Fix incorrect email.header.Header maxlinelen default (GH-120277) (GH-120279)
(cherry picked from commit 7c016deae6)

Co-authored-by: Clinton <pygeek@users.noreply.github.com>
2024-06-08 17:37:50 +00:00
Miss Islington (bot) a2003bd195
[3.13] gh-110383: Improve 'old string formatting' text in tutorial (GH-120219) (#120229)
(cherry picked from commit 225aab7f70)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-06-07 13:53:35 +00:00
Miss Islington (bot) ffa7d82a04
[3.13] gh-110383: Clarify "non-integral" wording in pow() docs (GH-119688) (#120206)
(cherry picked from commit 6646a9da26)

Co-authored-by: Aditya Borikar <adityaborikar2@gmail.com>
2024-06-07 10:03:06 +00:00
Miss Islington (bot) 0e6605f633
[3.13] Add Plausible for docs metrics (GH-119977) (#120193)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Julien Palard <julien@palard.fr>
2024-06-07 10:42:19 +03:00
Miss Islington (bot) 56a7e04834
[3.13] gh-119577: Adjust DeprecationWarning when testing element truth values in ElementTree (GH-119762) (GH-120189)
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.
(cherry picked from commit 6b606522ca)

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
2024-06-07 03:43:17 +00:00
Barney Gale d4566c0cfc
[3.13] GH-119054: Add "Reading directories" section to pathlib docs (GH-119956) (#120183)
Add a dedicated subsection for `Path.iterdir()`-related methods,
specifically `iterdir()`, `glob()`, `rglob()` and `walk()`.

(cherry picked from commit 14e1506a6d)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-06-07 01:23:49 +01:00
Miss Islington (bot) 8e0c80a486
[3.13] gh-119287: clarify doc on BaseExceptionGroup.derive and link to it from contextlib.suppress (GH-119657) (#120105)
gh-119287: clarify doc on BaseExceptionGroup.derive and link to it from contextlib.suppress (GH-119657)
(cherry picked from commit 5c02ea8bae)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-06-05 12:15:51 +00:00
Miss Islington (bot) df8a98abee
[3.13] gh-120078: Fix struct_time attr typo tm_day -> tm_mday in Doc/library/time.rst (GH-120085)
(cherry picked from commit b6b0dcbfc0)

Co-authored-by: shurj0 <60540027+shurj0@users.noreply.github.com>
2024-06-05 00:39:54 +00:00
Miss Islington (bot) a653562072
[3.13] gh-114616: Improve docs regarding changes to caches representation in dis (GH-120033) (#120079)
gh-114616: Improve docs regarding changes to caches representation in dis (GH-120033)
(cherry picked from commit 770f3c1ead)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-06-04 23:15:39 +00:00
Miss Islington (bot) 54023a63cc
[3.13] Fix incorrect pull GitHub link in What's New (GH-120045) (#120052)
Co-authored-by: Trey Hunner <trey@treyhunner.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-04 11:06:14 -06:00
Miss Islington (bot) 6725c78d37
[3.13] gh-119588: Update docs to reflect decision to include the change with Python 3.13 and not 3.12. (GH-120043) (#120046)
gh-119588: Update docs to reflect decision to include the change with Python 3.13 and not 3.12. (GH-120043)
(cherry picked from commit 4dcd91ceaf)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-06-04 15:39:49 +00:00
Miss Islington (bot) 34a6d89788
[3.13] gh-119588: Implement zipfile.Path.is_symlink (zipp 3.19.0). (GH-119591) (#119985)
gh-119588: Implement zipfile.Path.is_symlink (zipp 3.19.0). (GH-119591)
(cherry picked from commit 42a34ddb0b)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-06-04 10:56:06 -04:00
Miss Islington (bot) 1177897551
[3.13] gh-111389: Add PyHASH_MULTIPLIER constant (GH-119214) (#119334)
gh-111389: Add PyHASH_MULTIPLIER constant (GH-119214)
(cherry picked from commit f6da790122)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-06-04 09:26:25 +02:00
Miss Islington (bot) 6db1eb98a4
[3.13] gh-119968: Improved monitoring c-api docs (GH-119969) (#119971)
gh-119968: Improved monitoring c-api docs (GH-119969)
(cherry picked from commit cae4c80714)

Co-authored-by: Awbert <119314310+SweetyAngel@users.noreply.github.com>
2024-06-03 09:49:14 +00:00
Miss Islington (bot) 3709e1bbad
[3.13] gh-109975: What's New in Python 3.13: fix broken link for `telnetlib` alternative (GH-119958) (#119959)
(cherry picked from commit 117a8acdab)

Co-authored-by: Solomon Himelbloom <7608183+TechSolomon@users.noreply.github.com>
2024-06-03 00:59:41 +00:00
Miss Islington (bot) d33b0868d6
[3.13] GH-119054: Add "Reading and writing files" section to pathlib docs (GH-119524) (#119954)
Add a dedicated subsection for `open()`, `read_text()`, `read_bytes()`,
`write_text()` and `write_bytes()`.

(cherry picked from commit bd6d4ed645)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2024-06-02 19:58:41 +00:00
Barney Gale 590fd9ccd4
[3.13] GH-119054: Add "Querying file type and status" section to pathlib docs (GH-119055) (#119951)
Add a dedicated subsection for `Path.stat()`-related methods, specifically
`stat()`, `lstat()`, `exists()`, `is_*()`, and `samefile()`.

(cherry picked from commit 81d6336230)
2024-06-02 20:37:01 +01:00
Miss Islington (bot) cfec22ce19
[3.13] Improve documentation for typing.get_type_hints (GH-119928) (#119943)
- 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.

(cherry picked from commit aa9fe98e06)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-02 15:29:25 +00:00
Miss Islington (bot) cf8f292a36
[3.13] gh-118934: Fix PyEval_GetLocals docs (PEP 667) (GH-119934)
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)
(cherry picked from commit fd6cd621e0)

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2024-06-02 05:57:17 +00:00
Miss Islington (bot) 36ca00f44d
[3.13] gh-118888: Further PEP 667 docs updates (gh-119894)
* Clarify impact on default behaviour of exec, eval, etc
* Update documentation for changes to PyEval_GetLocals (gh-74929)

Closes gh-118888
(cherry picked from commit 2180991ea3)

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2024-06-02 15:41:25 +10:00
Miss Islington (bot) edb6883ef3
[3.13] gh-119016: Remove outdated sentences from the "classes" tutorial (GH-119130) (#119925)
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-01 21:35:03 +00:00
Miss Islington (bot) 99d0f51e61
[3.13] Add unique() recipe to itertools docs (gh-119911) (gh-119916) 2024-06-01 12:06:04 -05:00
Miss Islington (bot) 0a266f7e74
[3.13] gh-74929: PEP 667 C API documentation (gh-119892)
* 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

(cherry picked from commit 3859e09e3d)

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2024-06-01 04:23:04 +00:00
Miss Islington (bot) 5e8396e684
[3.13] doc: Add glossary entry for "free threading" (GH-119865) (#119874)
(cherry picked from commit 9bc6045842)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-05-31 17:42:36 +00:00
Miss Islington (bot) eb5e19aa68
[3.13] contextlib docs: Clean up redundant 'up' after 'cleanup' (GH-119872)
Reported by Michael Kass on docs@
(cherry picked from commit f3fc800d5f)
2024-05-31 17:39:02 +00:00
Miss Islington (bot) 24e3a8a9a6
[3.13] gh-100117: Fix inaccuracy in documentation of the CodeObject's co_positions field. (GH-119364) (#119869)
gh-100117: Fix inaccuracy in documentation of the CodeObject's co_positions field. (GH-119364)
(cherry picked from commit 015b1fdd0a)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-05-31 17:27:55 +00:00
Miss Islington (bot) d6faac6d1f
[3.13] gh-111201: Support pyrepl on Windows (GH-119559) (GH-119850)
(cherry picked from commit 0d07182821)

Co-authored-by: Dino Viehland <dinoviehland@gmail.com>
Co-authored-by: Anthony Shaw <anthony.p.shaw@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-31 17:18:28 +02:00
Miss Islington (bot) 1e75dc7324
[3.13] Docs: `shutil.rmtree`'s `onerror` has no pending removal version (GH-118947) (#119804)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-05-30 20:52:43 +00:00
Miss Islington (bot) 844b535c51
[3.13] gh-109218: Improve documentation for the complex() constructor (GH-119687) (GH-119803)
* 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.)
(cherry picked from commit ec1ba26460)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-05-30 20:44:20 +00:00
Miss Islington (bot) 608cfb8b41
[3.13] gh-119729: Use 't' in pkg-config file name for free-threaded build (GH-119738) (#119797)
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`.
(cherry picked from commit 1c04c63ced)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-05-30 18:17:05 +00:00
Miss Islington (bot) a7327b31e3
[3.13] gh-119779: Fix pyporting howto docs (GH-119785) (#119788)
gh-119779: Fix pyporting howto docs (GH-119785)
(cherry picked from commit 6fb191be15)

Co-authored-by: Awbert <119314310+SweetyAngel@users.noreply.github.com>
2024-05-30 16:09:31 +00:00
Miss Islington (bot) d1c7f5ed08
[3.13] gh-118055: Update the finder glossary entry (GH-118278) (GH-119773)
gh-118055: Update the finder glossary entry (GH-118278)
(cherry picked from commit db009348b4)

Co-authored-by: Lincoln <71312724+Lincoln-developer@users.noreply.github.com>
2024-05-30 09:07:59 +00:00
Miss Islington (bot) 1eddc9e6b6
[3.13] subprocess docs: Fix semantically important typo (GH-119752) (#119757)
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.
(cherry picked from commit 2cc3502f98)

Co-authored-by: Zachary Ware <zach@python.org>
2024-05-30 08:50:11 +01:00
Miss Islington (bot) 06c62d697a
[3.13] gh-119260: Clarify is_dataclass Behavior for Subclasses in Documentation and Tests (GH-119480) (#119760)
gh-119260: Clarify is_dataclass Behavior for Subclasses in Documentation and Tests (GH-119480)
(cherry picked from commit bf4ff3ad2e)

Co-authored-by: Aditya Borikar <adityaborikar2@gmail.com>
Co-authored-by: Carl Meyer <carl@oddbird.net>
2024-05-30 01:28:31 +00:00
Miss Islington (bot) cc8586a1ed
[3.13] Clarify base64.a85encode docs: *wrapcols* doesn't count the newline (GH-119409) (GH-119483)
Clarify base64.a85encode docs: *wrapcols* doesn't count the newline (GH-119409)
(cherry picked from commit ffa24aab10)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-05-28 16:55:37 +02:00
Miss Islington (bot) 47fb0f82cd
[3.13] [doc] Clarify the nature of the root logger in the `logging` documentation (GH-119440) (GH-119651)
(cherry picked from commit b407ad38fb)
2024-05-28 15:04:46 +01:00
Miss Islington (bot) 7322ff1561
[3.13] gh-119317: findall instead of traverse for docutils nodes (GH-119319) (#119486)
gh-119317: findall instead of traverse for docutils nodes (GH-119319)
(cherry picked from commit 0867bce457)

Co-authored-by: Carlos Meza <hire@carlosmeza.com>
2024-05-27 23:46:15 +00:00
Hugo van Kemenade 0a4a3184f5
[3.13] Docs: Move inline JavaScript to own file to reduce duplication (GH-119541) (#119630) 2024-05-27 12:49:52 -06:00
Miss Islington (bot) 8117cb5f01
[3.13] Misc cleanups and wording improvements for the itertools docs (gh-119626) (gh-119629) 2024-05-27 13:44:11 -05:00
Miss Islington (bot) 9edf0109eb
[3.13] gh-119580: Improve version added section for convenience variable (GH-119583) (#119624)
Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2024-05-27 18:13:01 +00:00
Miss Islington (bot) ba71835fa5
[3.13] Docs: Only install sphinx-autobuild for `make htmllive` (GH-119607) (#119621)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-05-27 17:44:55 +00:00
Miss Islington (bot) f1302c1e47
[3.13] gh-119467: Fix Py_buffer.format type and correct documentation typo (GH-119475) (#119602)
gh-119467: Fix Py_buffer.format type and correct documentation typo (GH-119475)
(cherry picked from commit 3b26cd8ca0)

Co-authored-by: Aditya Borikar <adityaborikar2@gmail.com>
2024-05-27 12:34:13 +00:00
Miss Islington (bot) 3f0198d927
[3.13] docs: fix a few typos identified by codespell (GH-119516) (#119570)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-05-26 08:20:37 +00:00
Miss Islington (bot) 317cc3bcd2
[3.13] FAQ: Add reference to Python version numbering scheme (GH-119225) (#119544)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-05-25 14:29:47 +00:00
Miss Islington (bot) f49749cf8f
[3.13] gh-111999: Fix the signature of str.format_map() (GH-119540) (#119543)
(cherry picked from commit 08e65430aa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-05-25 13:46:41 +00:00
Raymond Hettinger 5544651350
[3.13] Misc improvement to the docs for itertools (gh-119529) (#119531)
Misc improvement to the docs for itertools (gh-119529)
2024-05-24 17:26:25 -05:00
Miss Islington (bot) 392a3d8ade
[3.13] Regen ``Doc/requirements-oldest-sphinx.txt`` (GH-119520) (#119522)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-05-24 14:01:44 -06:00
Miss Islington (bot) c864efba25
[3.13] gh-118692: Avoid creating unnecessary StopIteration instances for monitoring (GH-119216) (#119497)
* gh-118692: Avoid creating unnecessary StopIteration instances for monitoring (GH-119216)
(cherry picked from commit 6e9863d7a3)

---------

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-05-24 10:18:13 +00:00
Miss Islington (bot) 89e2689545
[3.13] gh-90562: Mention slots pitfall in dataclass docs (GH-107391) (#119350)
Co-authored-by: Josh Cannon <joshdcannon@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-05-23 00:16:19 -06:00
Miss Islington (bot) a6ed7425d8
[3.13] gh-70795: Rework RLock documentation (GH-103853) (#119436)
gh-70795: Rework RLock documentation (GH-103853)

Attempted to simultaneously reduce verbosity, while more descriptively
describing behavior.

Fix links (RLock acquire/release previously linking to Lock
acquire/release, seems like bad copy pasta).

Add a seealso for with-locks.

Switch section to use bullet points.

---------

(cherry picked from commit 2fbea81d64)

Co-authored-by: uıɐɾ ʞ ʇɐɯɐs <_@skj.io>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2024-05-22 14:21:58 -07:00
Miss Islington (bot) 0bd7c879cf
[3.13] gh-112066: Fix versionadded in PyDict_SetDefaultRef docs (GH-118696) (#119430)
(cherry picked from commit 447edb6e98)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2024-05-22 15:36:35 -04:00
Miss Islington (bot) 414346e56d
[3.13] Fix version number in use_load_tests deprecation reference (GH-119151) (GH-119386)
Deprecation took place in d78742a260 (3.5)
(cherry picked from commit aee8f03abb)

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
2024-05-22 09:58:59 +00:00
Miss Islington (bot) f757996942
[3.13] Clarify that dklen is expected in bytes for the hashlib functions (GH-106624) (GH-119383)
(cherry picked from commit 5adf78f546)

Co-authored-by: Mathijs Mortimer <thiezn@users.noreply.github.com>
2024-05-22 09:10:02 +00:00
Miss Islington (bot) b5b0e3210d
[3.13] DOCS: fix error in exec namespace note (gh-119380)
When updating the new exec note added in gh-119235 as part of the
PEP 667 general docs PR, I suggested a workaround that isn't valid.

The first half of the note is still reasonable, so just omit the invalid text.

(cherry picked from commit 31d61a75c9)

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2024-05-22 06:58:36 +00:00
Miss Islington (bot) 455b386234
[3.13] gh-110383: Align dict.get(), .fromkeys(), and .setdefault() docs with docstrings (GH-119330) (#119370)
(cherry picked from commit 0e3c8cda1f)

Co-authored-by: Landon Wood <landon@elkrange.com>
2024-05-22 01:31:56 +00:00
Miss Islington (bot) 05820164ce
[3.13] Docs: Add central references to free-threading-related options (GH-119017) (#119367)
Docs: Add central references to free-threading-related options (GH-119017)
(cherry picked from commit 9fa206aaec)

Co-authored-by: Brett Simmers <swtaarrs@users.noreply.github.com>
2024-05-21 23:16:59 +00:00
Miss Islington (bot) 256b791fd6
[3.13] gh-110383: Document `socket.makefile()` accepts combined modes (GH-119150) (#119324)
The supported mode values are 'r', 'w', and 'b', or a combination of those.
(cherry picked from commit 62a29be5bb)

Co-authored-by: Daniel Williams <dann0a@gmail.com>
2024-05-21 18:44:53 +00:00
Miss Islington (bot) 11ca1d9d53
[3.13] GH-110383: Improve Tutorial for Input Ouput (GH-119230) (GH-119326)
GH-110383: Improve Tutorial for Input Ouput (GH-119230)

(cherry picked from commit 9db2fd7eda)

Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: edson duarte <eduarte.uatach@gmail.com>
2024-05-21 19:54:26 +02:00
Hugo van Kemenade 1929b7e2bf
[3.13] Docs: Ensure no warnings are found in the NEWS file before a given line number (GH-119221) (#119261) 2024-05-21 08:40:08 -06:00
Miss Islington (bot) db64dae745
[3.13] gh-74929: PEP 667 general docs update (gh-119291)
* expand on What's New entry for PEP 667 (including porting notes)
* define 'optimized scope' as a glossary term
* cover comprehensions and generator expressions in locals() docs
* review all mentions of "locals" in documentation (updating if needed)
* review all mentions of "f_locals" in documentation (updating if needed)

(cherry picked from commit e870c852c0)

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2024-05-21 21:35:26 +10:00
Miss Islington (bot) 24b0e8ddb4
[3.13] gh-118912: Remove description of issue fixed in 3.5 from autospeccing guide (GH-119232) (#119284)
gh-118912: Remove description of issue fixed in 3.5 from autospeccing guide (GH-119232)

* Remove description of issue fixed in 3.5 from autospeccing guide

* Make autospeccing note text more succint and lint whitespace

* Add linting changes (missed in last commit)

---------

(cherry picked from commit 7e57640c7e)

Co-authored-by: Shauna <shaunagm@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-05-20 23:50:23 +00:00
Miss Islington (bot) d8fbe5b64a
[3.13] gh-108267 Fix another dataclasses docs typo (GH-119277) (#119279)
gh-108267 Fix another dataclasses docs typo (GH-119277)
(cherry picked from commit 423bbcbbc4)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-05-20 22:53:32 +00:00
Miss Islington (bot) b4462aaed6
[3.13] gh-118760: Restore the default value of tkinter.wantobjects to 1 (GH-118784) (GH-119251)
It was set to 2 in 65f5e586a1 (GH-98592).
(cherry picked from commit e188527c34)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-05-20 20:28:42 +00:00
Miss Islington (bot) 906f6cb656
[3.13] Use correct markup in unittest.mock.reset_mock documentation (GH-119207) (GH-119250)
Use correct markup in unittest.mock.reset_mock documentation (GH-119207)
(cherry picked from commit 6b80a5b20f)

Co-authored-by: Tialo <65392801+Tialo@users.noreply.github.com>
2024-05-20 22:12:38 +02:00
Miss Islington (bot) fda3291643
[3.13] DOCS: Suggest always calling exec with a globals argument and no locals argument (GH-119235) (#119239)
DOCS: Suggest always calling exec with a globals argument and no locals argument (GH-119235)

Many users think they want a locals argument for various reasons but they do not
understand that it makes code be treated as a class definition. They do not want
their code treated as a class definition and get surprised. The reason not
to pass locals specifically is that the following code raises a `NameError`:

```py
exec("""
def f():
    print("hi")

f()

def g():
    f()
g()
""", {}, {})
```

The reason not to leave out globals is as follows:

```py
def t():
    exec("""
def f():
    print("hi")

f()

def g():
    f()
g()
    """)
```
(cherry picked from commit 7e1a130b8f)

Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
2024-05-20 18:15:25 +00:00
Miss Islington (bot) 8f3fc01c4c
[3.13] [docs] TypeVarTuple default is keyword-only (GH-119215) (#119224)
(cherry picked from commit e406b399f9)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2024-05-20 15:57:19 +00:00
Miss Islington (bot) cbf064b096
[3.13] typing docs: Fix formatting issue (GH-119210) (#119212)
typing docs: Fix formatting issue (GH-119210)
(cherry picked from commit 72d07dd30b)

Co-authored-by: David Foster <david@dafoster.net>
2024-05-20 15:08:49 +00:00
Miss Islington (bot) bc5e47ccb7
[3.13] marshal docs: Remove reference to "Sun" (GH-119161) (#119167)
Nobody has been using a Sun machine for a long time. When I saw
this sentence in a lightning talk just now, I thought it was talking
about sending Python code on a spacecraft.
(cherry picked from commit 697465ff88)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-05-19 02:33:04 +00:00
Miss Islington (bot) 641e59db59
[3.13] docs: make mimalloc license text literal (GH-119046) (#119149)
docs: make mimalloc license text literal (GH-119046)
(cherry picked from commit 691429702f)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2024-05-18 16:40:07 +00:00
Miss Islington (bot) 1bb3a9df1b
[3.13] gh-119078: Clarify venv tutorial (GH-119129) (GH-119142)
(cherry picked from commit 0f5e8bed63)
2024-05-18 13:06:23 +01:00
Miss Islington (bot) 374655fa83
[3.13] Minor improvements to the docs for itertools.tee() (gh-119135) (gh-119136) 2024-05-18 01:51:04 -05:00
Miss Islington (bot) c69fe804b6
[3.13] gh-108267: Fix object.__setattr__ regression in dataclasses docs (GH-119082) (#119097)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2024-05-16 13:56:42 +00:00
Miss Islington (bot) bca7fb0e7a
[3.13] Use literal syntax in origin property (GH-119029) (#119083)
Use literal syntax in origin property (GH-119029)
(cherry picked from commit 66b73e9724)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2024-05-16 05:30:33 +00:00
Miss Islington (bot) 7c224dd4cc
[3.13] gh-119009: Add gettext target (GH-119006) (#119074)
Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2024-05-15 18:31:55 +00:00
Miss Islington (bot) dd8a61f901
[3.13] 3.13 What's New: Add PEP 702 (GH-118922) (#119062)
I honestly forgot this slipped into 3.13, but I think it's worth highlighting more, as it is a PEP-sized change that makes the type system significantly more powerful.

@Yhg1s I think it's also worth mentioning in your release announcements.
(cherry picked from commit ee13797dec)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-05-15 02:56:37 +00:00
Miss Islington (bot) 8439d09aa1
[3.13] Misc improvements to the itertools docs (gh-119040) (#119045) 2024-05-14 15:38:53 +00:00
Miss Islington (bot) 87f683e09a
[3.13] Itertools docs: fix parameter names and indentation in Python equivalents (gh-118977) (#119043) 2024-05-14 15:11:31 +00:00
Miss Islington (bot) d1aac22b7a
[3.13] gh-119010: Adds docs about `__type_params__` to `functools.update_wrapper` (GH-119012) (#119013)
gh-119010: Adds docs about `__type_params__` to `functools.update_wrapper` (GH-119012)
(cherry picked from commit b04c497f18)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-05-13 20:19:10 +00:00
Miss Islington (bot) 941883208c
[3.13] Improve the `rmtree` doc for `dir_fd` param addition in 3.11 (GH-118964) (#118991)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-05-13 11:21:10 +00:00
Miss Islington (bot) 0874a400a8
[3.13] Correct the argument names for `secrets.choice` and `secrets.randbelow` in `secrets.rst` (GH-118098) (GH-118906)
Correct the argument names for `secrets.choice` and `secrets.randbelow` in `secrets.rst` (GH-118098)

Correct the argument names for `secrets.choice` and `secrets.randbelow` in `secrets.rst`.
(cherry picked from commit c444362c6e)

Co-authored-by: Adam Dangoor <adamdangoor@gmail.com>
2024-05-10 14:56:33 +00:00
Miss Islington (bot) 7dc9875d55
gh-118209: Add Windows structured exception handling to mmap module (GH-118213)
(cherry picked from commit e85e8deaf3)

Co-authored-by: Dobatymo <Dobatymo@users.noreply.github.com>
2024-05-10 12:00:00 +01:00
Miss Islington (bot) 760b3f08dc
gh-118689: Doc: fix ePub build (GH-118690)
(cherry picked from commit 7ac933e260)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2024-05-10 10:40:35 +00:00
Miss Islington (bot) 00ec116883
[3.13] gh-118851: Default ctx arguments to AST constructors to Load() (GH-118854) (#118871)
(cherry picked from commit 68fbc00dc8)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-05-09 22:52:42 +00:00
Steve Dower d86b494117
gh-118486: Update docs for CVE-2024-4030 reference (GH-118737)
Update docs for CVE-2024-4030 reference
2024-05-09 12:52:11 +01:00
Miss Islington (bot) 8f31af68d0
[3.13] Format None, True, False and NotImplemented as literals (GH-118758) (GH-118792)
(cherry picked from commit 05c2fe1acd)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-05-08 19:55:12 +00:00
Miss Islington (bot) c33bba6eb3
[3.13] docs: module page titles should not start with a link to themselves (GH-117099) (#118790)
docs: module page titles should not start with a link to themselves (GH-117099)
(cherry picked from commit bcb435ee8f)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-05-08 19:52:39 +00:00
Miss Islington (bot) 02d49af219
[3.13] Docs: fix typos in documentation (GH-118752) (#118787)
Docs: fix typos in documentation (GH-118752)
(cherry picked from commit 7b0c247f1c)

Co-authored-by: Xie Yanbo <xieyanbo@gmail.com>
2024-05-08 19:24:39 +00:00
Thomas Wouters 2268289a47 Python 3.13.0b1 2024-05-08 11:21:00 +02:00
trag1c c4f9823be2
gh-118671: Updated dead ActiveState links (#118730)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-05-08 01:06:38 -06:00
Kirill Podoprigora fcf52d7cee
Regen ``Doc/requirements-oldest-sphinx.txt`` (#118736)
Regen dependencies
2024-05-08 08:59:17 +03:00
T. Wouters f548855061
gh-109975: Make a rough editorial pass over What's New (#118711)
Make a rough editorial pass over Python 3.13's What's New document. Add the
release highlights, remove or merge some duplicated entries, and reorder
some of the sections (removals should really go before future deprecations).
2024-05-07 23:00:25 +02:00
chrysn f58833ebf8
gh-118650: Document `Enum._repr_*` reservation exclusion (GH-118698) 2024-05-07 11:11:18 -07:00
Pablo Galindo Salgado b9caa0977c
gh-118518: Improve perf docs (#118708) 2024-05-07 17:25:15 +01:00
Jelle Zijlstra 71080b8a0f
gh-118660: Add second type parameter to (Async)ContextManager (#118681)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-05-07 14:16:05 +00:00
Kerim Kabirov a855f824a2
Remove Python 3.5 hardcoded version in the tutorial appendix (GH-117612) 2024-05-07 15:28:16 +02:00
Serhiy Storchaka 65f5e586a1
gh-66410: Do not stringify arguments of Tkinter callback (GH-98592)
Callbacks registered in the tkinter module now take arguments as
various Python objects (int, float, bytes, tuple), not just str.
To restore the previous behavior set tkinter module global wantobject to 1
before creating the Tk object or call the wantobject() method of the Tk object
with argument 1.
Calling it with argument 2 restores the current default behavior.
2024-05-07 12:07:32 +00:00
Hugo van Kemenade 04859228aa
gh-118518: Rename `PYTHONPERFJITSUPPORT` and `-X perfjit` with underscores (#118693) 2024-05-07 11:47:21 +00:00
Momo Eissenhauer 48e52fe2c9
gh-118310: Fix documentation for `enum.Enum.__new__` (GH-118311)
The provided example was incorrect:
- The example enum was missing the `int` mixin as implied by the context
- The value of `int('1a', 16)` was incorrectly given as 17
  (should be 26)
2024-05-07 13:42:18 +02:00
Alex Waygood 44a9f3db2b
gh-109653: What's new: Note improved import times for several stdlib modules in Python 3.13 (#118697) 2024-05-07 11:34:19 +00:00
Hugo van Kemenade 6cf70678e2
gh-109975: Update 'What's New in Python 3.13' for beta (#118694) 2024-05-07 12:35:32 +02:00
Xie Yanbo 9762122235
Fix several typos in documentation (GH-118625) 2024-05-07 09:23:06 +00:00
Sam Gross 60bd111844
Docs: add whatsnew for free-threading (#118679)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-06 21:48:28 -04:00
Jelle Zijlstra e0422198fb
gh-117486: Improve behavior for user-defined AST subclasses (#118212)
Now, such classes will no longer require changes in Python 3.13 in the normal case.
The test suite for robotframework passes with no DeprecationWarnings under this PR.

I also added a new DeprecationWarning for the case where `_field_types` exists
but is incomplete, since that seems likely to indicate a user mistake.
2024-05-06 15:57:27 -07:00
Jelle Zijlstra 8419f01673
gh-118647: Add defaults to typing.Generator and typing.AsyncGenerator (#118648)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-05-06 22:35:06 +00:00
Erlend E. Aasland 325a1da18d
gh-115119: Default to --with-system-libmpdec=yes (#118539)
Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
2024-05-06 21:16:08 +02:00
Petr Viktorin 417dd3aca7
gh-116322: Rename PyModule_ExperimentalSetGIL to PyUnstable_Module_SetGIL (GH-118645) 2024-05-06 18:59:36 +02:00
Kerim Kabirov 3ed3bc379a
GH-115577 Clarify netloc term usage in urllib.parse docs (GH-117632) 2024-05-06 18:55:22 +02:00
Serhiy Storchaka 709ca90a00
gh-118271: Support more options for reading/writing images in Tkinter (GH-118273)
* Add PhotoImage.read() to read an image from a file.
* Add PhotoImage.data() to get the image data.
* Add background and grayscale parameters to PhotoImage.write().
2024-05-06 15:06:06 +00:00
Xie Yanbo fc50f1bdba
Fix typo in Doc/library/asyncio-task.rst (GH-118627) 2024-05-06 08:00:31 -07:00
Serhiy Storchaka 1b639a04ca
gh-118225: Support more options for copying images in Tkinter (GH-118228)
* Add the PhotoImage method copy_replace() to copy a region
  from one image to other image, possibly with pixel zooming and/or
  subsampling.
* Add from_coords parameter to PhotoImage methods copy(), zoom() and subsample().
* Add zoom and subsample parameters to PhotoImage method copy().
2024-05-06 17:33:15 +03:00
Serhiy Storchaka d6fa1d4bee
gh-66543: Add mimetypes.guess_file_type() (GH-117258) 2024-05-06 15:50:52 +03:00
Alyssa Coghlan 757fd3e010
gh-74929: locals() documentation update for PEP 667 (#118265)
Documentation wording taken from the
withdrawn PEP 558 (which had switched to the
Python level semantics proposed in PEP 667 prior
to its withdrawal).
2024-05-06 20:06:07 +10:00
Serhiy Storchaka 153b3f7530
gh-118465: Add __firstlineno__ attribute to class (GH-118475)
It is set by compiler with the line number of the first line of
the class definition.
2024-05-06 12:02:37 +03:00
Gregory P. Smith b744fa5d3e
gh-111140: minor docs typos cleanup in the C example API calls. (#118612) 2024-05-05 21:43:42 +00:00
Pablo Galindo Salgado f27f8c790a
gh-111201: A new Python REPL (GH-111567)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Marta Gómez Macías <mgmacias@google.com>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-05-05 21:32:23 +02:00
Guido van Rossum 9c13d9e37a
gh-74929: Rudimentary docs for PEP 667 (#118581)
This is *not* sufficient for the final 3.13 release, but it will do for beta 1:

- What's new entry
- Updated changelog entry (news blurb)
- Mention the proxy for f_globals in the datamodel and Python frame object docs

This doesn't have any C API details (what's new refers to the PEP).
2024-05-05 15:31:26 +00:00
Tian Gao 5a0022a1d7
GH-111744: Make breakpoint() enter the debugger immediately (GH-118579) 2024-05-05 07:05:01 -07:00
Raymond Hettinger c7c9b913c0
gh-118476: Fix corner cases in islice() rough equivalent. (Gh-118559) 2024-05-05 01:42:30 -05:00
Hugo van Kemenade 3b32575ed6
gh-118131: Command-line interface for the `random` module (#118132) 2024-05-05 06:30:03 +00:00
Pablo Galindo Salgado 1b22d801b8
gh-118518: Allow perf to work without frame pointers (#112254) 2024-05-05 03:07:29 +02:00
Tian Gao b034f14a4b
gh-74929: Implement PEP 667 (GH-115153) 2024-05-04 12:12:10 +01:00
Irit Katriel 85af789961
gh-111997: C-API for signalling monitoring events (#116413) 2024-05-04 08:23:50 +00:00
Raymond Hettinger 42dc5b4ace
gh-115532 Add kde_random() to the statistic module (#118210) 2024-05-03 23:13:36 -05:00
Raymond Hettinger 6d9e8e989e
Minor improvements to the itertools recipes (#118563) 2024-05-03 17:07:47 -05:00
Ned Batchelder 9d67b72a49
docs: clarify csv.DictReader's treatment of the first data row (#118549) 2024-05-03 08:48:27 -07:00
Brett Simmers c2627d6eea
gh-116322: Add Py_mod_gil module slot (#116882)
This PR adds the ability to enable the GIL if it was disabled at
interpreter startup, and modifies the multi-phase module initialization
path to enable the GIL when loading a module, unless that module's spec
includes a slot indicating it can run safely without the GIL.

PEP 703 called the constant for the slot `Py_mod_gil_not_used`; I went
with `Py_MOD_GIL_NOT_USED` for consistency with gh-104148.

A warning will be issued up to once per interpreter for the first
GIL-using module that is loaded. If `-v` is given, a shorter message
will be printed to stderr every time a GIL-using module is loaded
(including the first one that issues a warning).
2024-05-03 11:30:55 -04:00
Sam Gross 2dae505e87
gh-117514: Add `sys._is_gil_enabled()` function (#118514)
The function returns `True` or `False` depending on whether the GIL is
currently enabled. In the default build, it always returns `True`
because the GIL is always enabled.
2024-05-03 11:09:57 -04:00
Jelle Zijlstra ca269e58c2
gh-116126: Implement PEP 696 (#116129)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2024-05-03 06:17:32 -07:00
Nice Zombies 852263e108
gh-117492: Clarify documentation of `typing.Never` (#117678)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-05-03 06:02:11 -07:00
Tian Gao 4e2caf2aa0
gh-118500: Add pdb support for zipapp (#118501) 2024-05-02 21:53:27 +01:00
Pablo Galindo Salgado 6bcbee09df
gh-93502: Add new C-API functions to trace object creation and destruction (#115945) 2024-05-02 19:30:00 +02:00
Raphael Gaschignard 2770d5caca
gh-105879: Add support for keyword arguments to eval and exec (#105885)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-05-02 08:55:29 -07:00
Steve Dower 81939dad77
gh-118486: Support mkdir(mode=0o700) on Windows (GH-118488) 2024-05-02 15:20:43 +01:00
Serhiy Storchaka b3372481b6
gh-117903: Clarify that the staticmethod descriptor is callable (GH-117925) 2024-05-02 16:56:33 +03:00
Crowthebird 7c97dc8c95
gh-118216: Don't consider dotted `__future__` imports (#118267) 2024-05-02 06:32:20 -07:00
Andrew Zipperer a6b610a94b
docs: typo: tiny grammar change: "pointed by" -> "pointed to by" (#118411)
* docs: tiny grammar change: "pointed by" -> "pointed to by"

This commit uses "file pointed to by" to replace "file pointed by" in
 - doc for shutil.copytree
 - docstring for shutil.copytree
 - docstring _abc.PathBase.open
 - docstring for pathlib.Path.open
 - doc for os.copy_file_range
 - doc for os.splice

The docs use "file pointed to by" more frequently than
"file pointed by". So, this commit replaces the uses of
"file pointed by" in order to make the uses consistent
through the docs.

```bash
$ grep -ri 'pointed to by' cpython/
```
yields more results than
```bash
$ grep -ri 'pointed by' cpython/
```

Separately:

There are two occurrences of "tree pointed by":
 - cpython/Doc/library/xml.etree.elementtree.rst for
     `xml.etree.ElementInclude.include`
 - cpython/Lib/xml/etree/ElementInclude.py for `include`

For those uses of "tree pointed by", I expect "tree pointed to by"
instead. However, I found enough uses online of (a) "tree pointed by"
rather than (b) "tree pointed to by" to convince me that (a) is in
common use.

So, this commit does not replace those occurrences of "tree pointed by"
to "tree pointed to by". But I will replace them if a reviewer
believes it is correct to replace them.

* docs: typo: "exists and executable" -> "exists and is executable"

---------

Co-authored-by: Andrew-Zipperer <atzipperer@gmail.com>
2024-05-02 05:37:12 +00:00
Guido van Rossum a37b093228
gh-118335: Rename --experimental-interpreter on Windows to --experimental-jit-interpreter (#118497)
Also fix docs for this in whatsnew.
2024-05-02 00:48:34 +00:00
Filipe Laíns 97feb4a78b
GH-118174: specify the type for the path argument of shutil.which 2024-05-02 00:13:32 +01:00
Hugo van Kemenade 164e2c31c0
gh-117225: Document colour use in `doctest` (#118268) 2024-05-01 12:25:11 -06:00
Victor Stinner b52c753e0f
gh-110850: Add PyTime_TimeRaw() function (#118394)
Add "Raw" variant of PyTime functions:

* PyTime_MonotonicRaw()
* PyTime_PerfCounterRaw()
* PyTime_TimeRaw()

Changes:

* Add documentation and tests. Tests release the GIL while calling
  raw clock functions.
* py_get_system_clock() and py_get_monotonic_clock() now check that
  the GIL is hold by the caller if raise_exc is non-zero.
* Reimplement "Unchecked" functions with raw clock functions.

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-05-01 18:05:01 +00:00
Jason R. Coombs a8bcf3ec32
Expand the 'Extending' docs with an example. (#113187)
* Expand the 'Extending' docs to provide a minimal example. Closes python/importlib_metadata#427.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-05-01 17:04:02 +00:00
Guido van Rossum 7d83f7bcc4
gh-118335: Configure Tier 2 interpreter at build time (#118339)
The code for Tier 2 is now only compiled when configured
with `--enable-experimental-jit[=yes|interpreter]`.

We drop support for `PYTHON_UOPS` and -`Xuops`,
but you can disable the interpreter or JIT
at runtime by setting `PYTHON_JIT=0`.
You can also build it without enabling it by default
using `--enable-experimental-jit=yes-off`;
enable with `PYTHON_JIT=1`.

On Windows, the `build.bat` script supports
`--experimental-jit`, `--experimental-jit-off`,
`--experimental-interpreter`.

In the C code, `_Py_JIT` is defined as before
when the JIT is enabled; the new variable
`_Py_TIER2` is defined when the JIT *or* the
interpreter is enabled. It is actually a bitmask:
1: JIT; 2: default-off; 4: interpreter.
2024-04-30 18:26:34 -07:00
Miro Hrončok f7747f73a9
gh-109975: Document crypt_r as a possible replacement of crypt (#118439) 2024-04-30 21:25:25 +03:00
Tian Gao d7ac427a79
gh-117618: Make package.module searchable for breakpoints and clean up docs (#117619) 2024-04-30 18:18:01 +00:00
edson duarte 0f797402bc
gh-85453: Consistent backquotes on None occurences across datetime.rst (#118282) 2024-04-30 10:34:15 +02:00
Donghee Na 11cbf77f97
gh-118392: Add note about random.random for multi thread app (gh-118396) 2024-04-30 13:42:13 +09:00
Tian Gao 8e4fb5d260
gh-118359: Improve docs for Bdb.user_call (#118368)
The `argument_list` parameter of bdb.Bdb.user_call has been useless for 25 years. It is retained for backwards compatibility, but it will always be None.
2024-04-29 21:57:49 +01:00
Hugo van Kemenade 8d4b756fd3
Docs: Upgrade to Sphinx 7.3 (#118397) 2024-04-29 11:40:50 -06:00
Xie Yanbo 98739c9078
Fix typo in Doc/c-api/exceptions.rst (GH-118371) 2024-04-29 14:02:54 +03:00
Xie Yanbo 0315521c52
Fix typo in Doc/howto/timerfd.rst (GH-118376) 2024-04-29 14:01:03 +03:00
Xie Yanbo 030fcc47fb
Fix typo in Doc/c-api/typeobj.rst (GH-118377) 2024-04-29 10:59:38 +00:00
Erlend E. Aasland c7e7bfc4ca
gh-115119: Detect _decimal dependencies using pkg-config (#115406)
pkg-config is supported for libmpdec 4.0.0 and newer.
2024-04-29 08:58:57 +02:00
Henrik Tunedal 133c1a7cdb
gh-118293: Suppress mouse cursor feedback when launching Windows processes with multiprocessing (GH-118315) 2024-04-28 21:10:44 +00:00
Hugo van Kemenade f5b7e397c0
gh-101100: Fix Sphinx warnings in `whatsnew/3.10.rst` (#118356) 2024-04-28 18:12:25 +00:00
Hugo van Kemenade 33c6cf3148
gh-101100: Fix Sphinx warnings in `library/faulthandler.rst` (#118353) 2024-04-28 12:06:45 -06:00
Hugo van Kemenade e0ab642436
gh-101100: Fix Sphinx warnings in `whatsnew/3.9.rst` (#118364) 2024-04-28 20:31:22 +03:00
Jelle Zijlstra 2326d6c868
gh-109118: Make comprehensions work within annotation scopes, but without inlining (#118160)
Co-authored-by: Carl Meyer <carl@oddbird.net>
2024-04-28 06:21:28 -07:00
Cheryl Sabella 194fd17bc6
bpo-32839: Add the after_info() method for Tkinter widgets (GH-5664) 2024-04-27 00:27:58 +03:00
Philipp A 5a4d3df2fa
Fix note in Enum.__new__ docs (#118284) 2024-04-26 07:06:53 -07:00
Kirill Podoprigora 463c20dae9
gh-117928: Bump the minimum Sphinx version to 6.2.1 (#117853)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-04-26 13:10:16 +03:00
Petr Viktorin ef940dec40
gh-118235: Skip RAISE_SYNTAX_ERROR rules in the grammar spec (GH-118237) 2024-04-26 11:01:30 +02:00
Serhiy Storchaka 93b7ed7c6b
gh-108191: Add support of positional argument in SimpleNamespace constructor (GH-108195)
SimpleNamespace({'a': 1, 'b': 2}) and SimpleNamespace([('a', 1), ('b', 2)])
are now the same as SimpleNamespace(a=1, b=2).
2024-04-25 00:39:54 +03:00
edson duarte 59a4d52973
gh-85453: Make numeric literals consistent across datetime.rst (#118245)
Remove code formatting from remaining numeric literals.
2024-04-24 20:19:54 +00:00
edson duarte 809aa9a682
gh-85453: Adapt datetime.rst to devguide recommendations for code snippets and variables (#118068)
Also remove formatting from numeric literals.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-04-24 19:53:52 +00:00
Alex Waygood 8227883d1f
gh-118013: Use weakrefs for the cache key in `inspect._shadowed_dict` (#118202) 2024-04-24 15:55:02 +01:00
Nikita Sobolev 692e902c74
gh-116023: Add `show_empty=False` to `ast.dump` (#116037)
Co-authored-by: Carl Meyer <carl@oddbird.net>
2024-04-24 11:02:38 +03:00
Animesh Kumar 0d221e9a19
Fix typo in py_compile.rst (GH-118102) 2024-04-23 17:12:49 +00:00
Shantanu 8e86579cae
gh-95754: Better error when script shadows a standard library or third party module (#113769) 2024-04-22 18:24:21 -07:00
Jelle Zijlstra 85f727c5fb
gh-109118: Allow lambdas in annotation scopes in classes (#118019) 2024-04-22 12:50:26 -07:00
tahia 8974a63f5e
bpo-18108: Adding dir_fd and follow_symlinks keyword args to shutil.chown (GH-15811)
* Adding dir_fd and follow_symlinks keyword args to shutil.chown
* Extending test_shutil.TestShutil.test_chown to include new kwargs
* Updating shutil.chown documentation

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
2024-04-22 18:23:36 +00:00
Nice Zombies 78ba4cb758
gh-118030: Group definitions for `ParamSpecArgs` and `ParamSpecKwargs` in `typing.rst` (#118154) 2024-04-22 14:57:46 +00:00
Kerim Kabirov ceb6038b05
gh-115986 Improve pprint documentation accuracy (#117403)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-04-22 12:28:21 +02:00
Clément Robert 1446024124
Docs: replace Harry Potter reference with Monty Python (#118130) 2024-04-21 19:03:46 +01:00
Serhiy Storchaka 51ef89cd9a
gh-115961: Add name and mode attributes for compressed file-like objects (GH-116036)
* Add name and mode attributes for compressed and archived file-like objects
  in modules bz2, lzma, tarfile and zipfile.
* Change the value of the mode attribute of GzipFile from integer (1 or 2)
  to string ('rb' or 'wb').
* Change the value of the mode attribute of ZipExtFile from 'r' to 'rb'.
2024-04-21 11:46:39 +03:00
Russell Keith-Magee df987331d8
gh-114099: Formalize Tier 3 status of iOS (GH-118020) 2024-04-20 23:04:08 -04:00
Quazi Irfan 1558d99316
Clarifying nonlocal doc: SyntaxError is raised if nearest enclosing scope is global (#114009)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-04-20 18:42:51 -07:00
Nikita Sobolev 2aa11cca11
gh-118100: Improve links in `ast.rst` (#118101)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-04-19 21:25:54 +03:00
Alex Waygood 1e3e7ce11e
gh-114053: Fix bad interaction of PEP-695, PEP-563 and ``get_type_hints`` (#118009)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-04-19 13:03:44 +00:00
lyc8503 15b3555e4a
gh-116931: Add fileobj parameter check for Tarfile.addfile (GH-117988)
Tarfile.addfile now throws an ValueError when the user passes
in a non-zero size tarinfo but does not provide a fileobj,
instead of writing an incomplete entry.
2024-04-19 11:41:51 +00:00
Irit Katriel 8a01fd7b9b
gh-115775: Add whatsnew entry about __static_attributes__ (GH-117909)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-04-19 12:57:31 +02:00
Savannah Ostrowski 5d54436574
gh-116935: Document that heap types need to support garbage collection (GH-118021) 2024-04-19 09:29:23 +00:00
Victor Stinner 4605a197bd
gh-117518: Clarify PyTuple_GetItem() borrowed reference in the doc (GH-117920) 2024-04-19 10:41:37 +02:00