gh-127833: Add links to token types to the lexical analysis intro (GH-131468)
(cherry picked from commit 45bb5ba61a)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Doc: Allow translating a code block in the tutorial (GH-131353)
(cherry picked from commit 3224b99872)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-133641: Doc: Add missing source link in ``concurrent.futures`` (GH-133642)
(cherry picked from commit 4fcd377563)
Co-authored-by: Jonas Obrist <ojiidotch@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-133403: Type `Tools/build/update_file.py` and check it with `mypy` (GH-133404)
(cherry picked from commit 50b52cba2d)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Zachary Ware <zach@python.org>
gh-133551: Skip annotationlib for now in ast roundtrip tests (GH-133634)
(cherry picked from commit 0a3ccb8dff)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
gh-133555: Allow regenerating the parser with Python < 3.14 (GH-133557)
(cherry picked from commit b48599b801)
Co-authored-by: Alex Prengère <2138730+alexprengere@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-127833: lexical analysis: Add backticks to BOM example (GH-132407)
(cherry picked from commit 0552ce0fb2)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
gh-133551: Support t-strings in annotationlib (GH-133553)
I don't know why you'd use t-strings in annotations, but now if you do,
the STRING format will do a great job of recovering the source code.
(cherry picked from commit 90f476e0f8)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This reverts commit 3c73cf5 (gh-133497), which itself reverted
the original commit d270bb5 (gh-133221).
We reverted the original change due to failing android tests.
The checks in _PyCode_CheckNoInternalState() were too strict,
so we've relaxed them.
gh-133558: Skip test_pdb tests on FreeBSD (GH-133566)
'\x08' is not interpreted as backspace on FreeBSD.
(cherry picked from commit 79b8a32fcb)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-133361: move the explanation of dict equal before its use (GH-133424)
Also move up the explanation of insertion order preservation. Both paragraphs seemed out of place down where they were.
---------
(cherry picked from commit 61ac88c06e)
Co-authored-by: Yongzi Li <1538321957@qq.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Also add the python3.14.abi file as generated by the new job and remove
the 'main branch only' entry from .gitignore.
The only difference from the 3.13 job is the addition of `with.python-version: 3.x`
to the `setup-python` configuration to pacify a warning.
Fix data race detected by tsan
(4171271720):
young.count can be modified by other threads even while the gcstate is
locked.
This is the simplest fix to (potentially) unblock beta 1, although this
particular code path seems like it could just be an atomic swap followed by
an atomic add, without having the lock at all.
Remove unnecessary strings, use of Union[], use of List[], and reliance
on implicit Optional.
These type annotations are not actually used for anything but I feel
we should set a good example.
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Rogdham <contact@rogdham.net>
This is a follow-up to gh-133107. I realized that we could end up with an
infinite recursion if we try to run a function from __main__ in a subinterpreter.
"Stateless" code is a function or code object which does not rely on external state or internal state.
It may rely on arguments and builtins, but not globals or a closure. I've left a comment in
pycore_code.h that provides more detail.
We also add _PyFunction_VerifyStateless(). The new functions will be used in several later changes
that facilitate "sharing" functions and code objects between interpreters.