| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
gh-124370: Add "howto" for free-threaded Python (GH-124371)
(cherry picked from commit 68e384c2179fba41bc3be469e6ef34927a37f4a5)
Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: mpage <mpage@cs.stanford.edu>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
__firstlineno__ in classes (GH-123613) (#124735)
* Setting the __module__ attribute for a class now removes the
__firstlineno__ item from the type's dict.
* The _collections_abc and _pydecimal modules now completely replace the
collections.abc and decimal modules after importing them. This
allows to get the source of classes and functions defined in these
modules.
* inspect.findsource() now checks whether the first line number for a
class is out of bound.
(cherry picked from commit 69a4063ca516360b5eb96f5432ad9f9dfc32a72e)
|
| |
|
|
|
|
|
| |
gh-81263: Add assignment expressions to `help` (#124641)
* Add assignment expression (:=) to `help`
* Update index for Assignment Expressions to include pair of `assignment; expression`
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-124377) (#124380)
* GH-65961: Document the deprecation of `__package__` and `__cached__` (GH-124377)
The code changes for warning related to `__package__` landed in Python 3.12. `__cached__` doesn't have any changes as it isn't used but only set by the import system.
(cherry picked from commit 67201ad53ff11576c69a9b762540b77128285f8d)
---------
Co-authored-by: Brett Cannon <brett@python.org>
Co-authored-by: Barry Warsaw <barry@python.org>
|
| |
|
|
|
|
|
|
|
| |
(#124569)
Closes GH-123242. The real criterion is that the attribute does not
exist on heap types, but I don't think we should discuss heap vs.
static types in the language reference.
(cherry picked from commit 99b23c64de301c9e77add6b0d8e60118ef807840)
|
| |
|
|
|
|
|
|
|
|
| |
gh-101100: Make __subclasses__ doctest stable (GH-124577)
Using a standard library class makes this test difficult to maintain
as other tests and other parts of the stdlib may create subclasses,
which may still be alive when this test runs depending on GC timing.
(cherry picked from commit 08a467b537b3d9b499d060697e79b3950374ab0f)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gh-115528: Update language reference for PEP 646 (GH-121181)
To recap: the objective is to make starred expressions valid in `subscription`,
which is used for generics: `Generic[...]`, `list[...]`, etc.
What _is_ gramatically valid in such contexts? Seemingly any of the following.
(At least, none of the following throw `SyntaxError` in a 3.12.3 REPL.)
Generic[x]
Generic[*x]
Generic[*x, y]
Generic[y, *x]
Generic[x := 1]
Generic[x := 1, y := 2]
So introducting
flexible_expression: expression | assignment_expression | starred_item
end then switching `subscription` to use `flexible_expression` sorts that.
But then we need to field `yield` - for which any of the following are
apparently valid:
yield x
yield x,
yield x, y
yield *x,
yield *x, *y
Introducing a separate `yield_list` is the simplest way I've been figure out to
do this - separating out the special case of `starred_item ,`.
(cherry picked from commit 7d3497f617edf77cb6ead6f5e62bce98d77b9ab8)
Co-authored-by: Matthew Rahtz <matthew.rahtz@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
| |
|
|
| |
section of the data model docs (#124480) (#124556)
|
| |
|
|
|
|
|
|
|
|
|
| |
(GH-124144) (#124151)
GH-103484: Fix permanently redirects reported by linkcheck (GH-124144)
Fix redirects reported by linkcheck, update docs conf.py checks.
(cherry picked from commit 0a32c6959c265d21d7c43fe8e4aefc8c0983e85e)
Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
| |
(GH-123623)
gh-123580: Fix `signed_number` token in documentation (GH-123582)
(cherry picked from commit 9e079c220b7f64d78a1aa36a23b513d7f377a694)
Co-authored-by: CBerJun <121291537+CBerJun@users.noreply.github.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
|
| |
|
|
|
|
|
|
| |
(GH-123648) (#123653)
gh-123621: Fix `datamodel.rst` with proper `dict` notation (GH-123648)
(cherry picked from commit cfbc841ef3c27b3e65d1223bf8fedf1f652137bc)
Co-authored-by: Lipták Attila (Flash) <113017309+AttilaLiptak@users.noreply.github.com>
|
| |
|
|
|
| |
(cherry picked from commit 68fe5758bf1900ffdcdf7cd9e40f5018555a39d4)
Co-authored-by: Shaygan Hooshyari <sh.hooshyari@gmail.com>
|
| |
|
|
| |
(GH-123577)
|
| | |
|
| |
|
|
|
|
|
|
|
| |
(GH-122702) (#122914)
gh-122701: Fix wording of raw strings/bytes in `lexical_analysis.rst` (GH-122702)
(cherry picked from commit ea70439bd2b5a1c881342646f30942f527f61373)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
| |
mutable/immutable types (GH-122512) (#122778)
gh-122511: Improve documentation for object identity of mutable/immutable types (GH-122512)
(cherry picked from commit 76bdeebef6c6206f3e0af1e42cbfc75c51fbb8ca)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
|
| |
|
|
|
|
|
| |
(#122446) (#122621)
gh-122445: populate only modified fields in __static_attributes__ (#122446)
(cherry picked from commit 498376d7a7d6f704f22a2c963130cc15c17e7a6f)
|
| |
|
|
|
|
|
|
| |
(GH-122471) (#122479)
Remove outdated note about instance methods from datamodel.rst (GH-122471)
(cherry picked from commit c68cb8e0c9bd75ded25578c2fba6469e55a06e93)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
|
| |
|
|
|
| |
point" (GH-121907) (GH-122012)
(cherry picked from commit 1a0c7b9ba48a2dffb70bb0c7327abae1d3e87356)
|
| |
|
|
|
|
|
|
|
| |
(GH-120451) (#121715)
gh-120452: improve documentation about private name mangling (GH-120451)
(cherry picked from commit f4d6e45c1e7161878b36ef9e876ca3e44b80a97d)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 715ec630dd78819ed79cad5ac28617daefe1e745)
Co-authored-by: Jongbum Won <71166964+Wondaeng@users.noreply.github.com>
|
| |
|
|
|
|
|
|
| |
behavior (GH-121175) (#121234)
gh-114104: clarify asynchronous comprehension docs to match runtime behavior (GH-121175)
(cherry picked from commit 91313afdb392d0d6105e9aaa57b5a50112b613e7)
Co-authored-by: Danny Yang <yangdanny97@users.noreply.github.com>
|
| |
|
|
|
|
|
|
| |
operations (GH-119931) (#120063)
doc: Mention the missing reflected special methods for all binary operations (GH-119931)
(cherry picked from commit bf5e1065f4ec2077c6ca352fc1ad940a76d1f6c9)
Co-authored-by: Paulo Freitas <me@paulofreitas.me>
|
| |
|
|
|
|
|
|
|
| |
(GH-120940) (#121061)
gh-120937: Reference weakref from the `__del__` documentation (GH-120940)
(cherry picked from commit 1c13b29d54ad6d7c9e030227d575ad7d21b4054f)
Co-authored-by: chaen <christophe.haen@cern.ch>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
| |
(#120750)
(cherry picked from commit 58b3f111767148e9011ccd52660e208f0c834b2a)
Co-authored-by: Danny Yang <yangdanny97@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
(GH-120535) (#120555)
This behavior is rather surprising and it was not clearly specified.
(cherry picked from commit 9e0b11eb21930b7b8e4a396200a921e9985cfca4)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 fd6cd621e0cce6ba2e737103d2a62b5ade90f41f)
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
|
| |
|
|
|
|
|
|
| |
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 015b1fdd0ae03f94a5dfda051b020810d1c952dd)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
* 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 e870c852c0ea96fa4e4569e9c39c7ceb80ce858d)
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
|
| |
|
|
| |
It is set by compiler with the line number of the first line of
the class definition.
|
| |
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
| |
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>
|
| |
|
|
|
| |
global (#114009)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
| |
|
|
|
| |
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>
|
| | |
|
| |
|
| |
Co-authored by Terry Jan Reedy
|
| |
|
|
|
| |
Define 'nonlocal scopes' in a way that excludes class scopes.
Rearrange the rest of the doc. Add "Programmer's note".
|
| |
|
|
|
| |
---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
|
| |
|
|
|
|
| |
In Lexical Analysis f-strings section, NULL in the description
of 'literal character' means '\0'. In the format_spec grammar
production, it is wrong with that meaning and redundant if
instead interpreted as <nothing>. Remove it there.
|
| |
|
|
| |
(GH-116298)
|
| | |
|
| |
|
|
| |
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
| | |
|
| |
|
|
| |
Thanks to Pedro Arthur Duarte (pedroarthur.jedi at gmail.com) for help with this bug.
|
| | |
|
| |
|
|
| |
documentation (#115411)
|
| |
|
|
| |
(#114662)
|
| |
|
|
| |
A 'single tuple' means 'one typle, of whatever length.
Remove the unneeded and slight distracting parenthetical 'singleton' comment.
|
| | |
|
| | |
|