Skip to content

Commit 704c336

Browse files
authored
Merge branch 'main' into c-recursion-limit
2 parents e52137f + 1775091 commit 704c336

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+519
-327
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,7 @@ jobs:
658658
build_asan,
659659
build_tsan,
660660
test_hypothesis,
661+
cross-build-linux,
661662
'
662663
|| ''
663664
}}

.github/workflows/tail-call.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
- aarch64-apple-darwin/clang
4242
- x86_64-unknown-linux-gnu/gcc
4343
- aarch64-unknown-linux-gnu/gcc
44+
- free-threading
4445
llvm:
4546
- 19
4647
include:
@@ -65,6 +66,9 @@ jobs:
6566
- target: aarch64-unknown-linux-gnu/gcc
6667
architecture: aarch64
6768
runner: ubuntu-22.04-arm
69+
- target: free-threading
70+
architecture: x86_64
71+
runner: ubuntu-24.04
6872
steps:
6973
- uses: actions/checkout@v4
7074
with:
@@ -105,11 +109,20 @@ jobs:
105109
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
106110
107111
- name: Native Linux (release)
108-
if: runner.os == 'Linux'
112+
if: runner.os == 'Linux' && matrix.target != 'free-threading'
109113
run: |
110114
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
111115
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
112116
CC=clang-19 ./configure --with-tail-call-interp
113117
make all --jobs 4
114118
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
115119
120+
- name: Native Linux with free-threading (release)
121+
if: matrix.target == 'free-threading'
122+
run: |
123+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
124+
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
125+
CC=clang-19 ./configure --with-tail-call-interp --disable-gil
126+
make all --jobs 4
127+
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
128+

Doc/c-api/unicode.rst

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,8 @@ the Python configuration.
256256
257257
.. c:function:: int Py_UNICODE_ISPRINTABLE(Py_UCS4 ch)
258258
259-
Return ``1`` or ``0`` depending on whether *ch* is a printable character.
260-
Nonprintable characters are those characters defined in the Unicode character
261-
database as "Other" or "Separator", excepting the ASCII space (0x20) which is
262-
considered printable. (Note that printable characters in this context are
263-
those which should not be escaped when :func:`repr` is invoked on a string.
264-
It has no bearing on the handling of strings written to :data:`sys.stdout` or
265-
:data:`sys.stderr`.)
259+
Return ``1`` or ``0`` depending on whether *ch* is a printable character,
260+
in the sense of :meth:`str.isprintable`.
266261
267262
268263
These APIs can be used for fast direct character conversions:

Doc/library/stdtypes.rst

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,13 +2012,19 @@ expression support in the :mod:`re` module).
20122012

20132013
.. method:: str.isprintable()
20142014

2015-
Return ``True`` if all characters in the string are printable or the string is
2016-
empty, ``False`` otherwise. Nonprintable characters are those characters defined
2017-
in the Unicode character database as "Other" or "Separator", excepting the
2018-
ASCII space (0x20) which is considered printable. (Note that printable
2019-
characters in this context are those which should not be escaped when
2020-
:func:`repr` is invoked on a string. It has no bearing on the handling of
2021-
strings written to :data:`sys.stdout` or :data:`sys.stderr`.)
2015+
Return true if all characters in the string are printable, false if it
2016+
contains at least one non-printable character.
2017+
2018+
Here "printable" means the character is suitable for :func:`repr` to use in
2019+
its output; "non-printable" means that :func:`repr` on built-in types will
2020+
hex-escape the character. It has no bearing on the handling of strings
2021+
written to :data:`sys.stdout` or :data:`sys.stderr`.
2022+
2023+
The printable characters are those which in the Unicode character database
2024+
(see :mod:`unicodedata`) have a general category in group Letter, Mark,
2025+
Number, Punctuation, or Symbol (L, M, N, P, or S); plus the ASCII space 0x20.
2026+
Nonprintable characters are those in group Separator or Other (Z or C),
2027+
except the ASCII space.
20222028

20232029

20242030
.. method:: str.isspace()

Doc/using/configure.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,9 +575,6 @@ also be used to improve performance.
575575
.. versionchanged:: 3.12
576576
Use ThinLTO as the default optimization policy on Clang if the compiler accepts the flag.
577577

578-
.. versionchanged:: next
579-
Revert to using full LTO as the default optimization policy on Clang.
580-
581578
.. option:: --enable-bolt
582579

583580
Enable usage of the `BOLT post-link binary optimizer

Doc/whatsnew/3.14.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,10 +1279,6 @@ Build changes
12791279
* GNU Autoconf 2.72 is now required to generate :file:`configure`.
12801280
(Contributed by Erlend Aasland in :gh:`115765`.)
12811281

1282-
* CPython now uses Full LTO as the default link time optimization policy
1283-
on Clang. This reverts an earlier change in CPython 3.12.
1284-
(Contributed by Ken Jin in :gh:`130049`.)
1285-
12861282
.. _whatsnew314-pep761:
12871283

12881284
PEP 761: Discontinuation of PGP signatures

Grammar/python.gram

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ import_name[stmt_ty]: 'import' a=dotted_as_names { _PyAST_Import(a, EXTRA) }
207207
# note below: the ('.' | '...') is necessary because '...' is tokenized as ELLIPSIS
208208
import_from[stmt_ty]:
209209
| 'from' a=('.' | '...')* b=dotted_name 'import' c=import_from_targets {
210-
_PyAST_ImportFrom(b->v.Name.id, c, _PyPegen_seq_count_dots(a), EXTRA) }
210+
_PyPegen_checked_future_import(p, b->v.Name.id, c, _PyPegen_seq_count_dots(a), EXTRA) }
211211
| 'from' a=('.' | '...')+ 'import' b=import_from_targets {
212212
_PyAST_ImportFrom(NULL, b, _PyPegen_seq_count_dots(a), EXTRA) }
213213
import_from_targets[asdl_alias_seq*]:

Include/internal/pycore_object.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ PyAPI_FUNC(int) _PyObject_IsFreed(PyObject *);
7474
{ \
7575
.ob_ref_local = _Py_IMMORTAL_REFCNT_LOCAL, \
7676
.ob_flags = _Py_STATICALLY_ALLOCATED_FLAG, \
77+
.ob_gc_bits = _PyGC_BITS_DEFERRED, \
7778
.ob_type = (type) \
7879
}
7980
#else
@@ -612,7 +613,7 @@ _Py_TryIncrefCompare(PyObject **src, PyObject *op)
612613
static inline int
613614
_Py_TryIncrefCompareStackRef(PyObject **src, PyObject *op, _PyStackRef *out)
614615
{
615-
if (_Py_IsImmortal(op) || _PyObject_HasDeferredRefcount(op)) {
616+
if (_PyObject_HasDeferredRefcount(op)) {
616617
*out = (_PyStackRef){ .bits = (intptr_t)op | Py_TAG_DEFERRED };
617618
return 1;
618619
}

Include/internal/pycore_pylifecycle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ extern PyStatus _Py_PreInitializeFromConfig(
7575

7676
extern wchar_t * _Py_GetStdlibDir(void);
7777

78-
extern int _Py_HandleSystemExit(int *exitcode_p);
78+
extern int _Py_HandleSystemExitAndKeyboardInterrupt(int *exitcode_p);
7979

8080
extern PyObject* _PyErr_WriteUnraisableDefaultHook(PyObject *unraisable);
8181

Include/internal/pycore_stackref.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ PyStackRef_FromPyObjectNew(PyObject *obj)
219219
// Make sure we don't take an already tagged value.
220220
assert(((uintptr_t)obj & Py_TAG_BITS) == 0);
221221
assert(obj != NULL);
222-
if (_Py_IsImmortal(obj) || _PyObject_HasDeferredRefcount(obj)) {
222+
if (_PyObject_HasDeferredRefcount(obj)) {
223223
return (_PyStackRef){ .bits = (uintptr_t)obj | Py_TAG_DEFERRED };
224224
}
225225
else {

0 commit comments

Comments
 (0)