Skip to content

Commit 542aaa4

Browse files
committed
Merge branch 'main' into fix-issue-135447
2 parents 0550bd2 + e18dda9 commit 542aaa4

File tree

135 files changed

+4552
-1663
lines changed

Some content is hidden

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

135 files changed

+4552
-1663
lines changed

.github/workflows/jit.yml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,34 @@ jobs:
134134
make all --jobs 4
135135
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
136136
137+
jit-with-disabled-gil:
138+
name: Free-Threaded (Debug)
139+
needs: interpreter
140+
runs-on: ubuntu-24.04
141+
timeout-minutes: 90
142+
strategy:
143+
fail-fast: false
144+
matrix:
145+
llvm:
146+
- 19
147+
steps:
148+
- uses: actions/checkout@v4
149+
with:
150+
persist-credentials: false
151+
- uses: actions/setup-python@v5
152+
with:
153+
python-version: '3.11'
154+
- name: Build with JIT enabled and GIL disabled
155+
run: |
156+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
157+
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
158+
./configure --enable-experimental-jit --with-pydebug --disable-gil
159+
make all --jobs 4
160+
- name: Run tests
161+
run: |
162+
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
163+
continue-on-error: true
164+
137165
no-opt-jit:
138166
name: JIT without optimizations (Debug)
139167
needs: interpreter
@@ -160,31 +188,3 @@ jobs:
160188
- name: Run tests without optimizations
161189
run: |
162190
PYTHON_UOPS_OPTIMIZE=0 ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
163-
164-
# XXX: GH-133171
165-
# jit-with-disabled-gil:
166-
# name: Free-Threaded (Debug)
167-
# needs: interpreter
168-
# runs-on: ubuntu-24.04
169-
# timeout-minutes: 90
170-
# strategy:
171-
# fail-fast: false
172-
# matrix:
173-
# llvm:
174-
# - 19
175-
# steps:
176-
# - uses: actions/checkout@v4
177-
# with:
178-
# persist-credentials: false
179-
# - uses: actions/setup-python@v5
180-
# with:
181-
# python-version: '3.11'
182-
# - name: Build with JIT enabled and GIL disabled
183-
# run: |
184-
# sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
185-
# export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
186-
# ./configure --enable-experimental-jit --with-pydebug --disable-gil
187-
# make all --jobs 4
188-
# - name: Run tests
189-
# run: |
190-
# ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3

Doc/c-api/weakref.rst

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -64,30 +64,6 @@ as much as it can.
6464
.. versionadded:: 3.13
6565
6666
67-
.. c:function:: PyObject* PyWeakref_GetObject(PyObject *ref)
68-
69-
Return a :term:`borrowed reference` to the referenced object from a weak
70-
reference, *ref*. If the referent is no longer live, returns ``Py_None``.
71-
72-
.. note::
73-
74-
This function returns a :term:`borrowed reference` to the referenced object.
75-
This means that you should always call :c:func:`Py_INCREF` on the object
76-
except when it cannot be destroyed before the last usage of the borrowed
77-
reference.
78-
79-
.. deprecated-removed:: 3.13 3.15
80-
Use :c:func:`PyWeakref_GetRef` instead.
81-
82-
83-
.. c:function:: PyObject* PyWeakref_GET_OBJECT(PyObject *ref)
84-
85-
Similar to :c:func:`PyWeakref_GetObject`, but does no error checking.
86-
87-
.. deprecated-removed:: 3.13 3.15
88-
Use :c:func:`PyWeakref_GetRef` instead.
89-
90-
9167
.. c:function:: int PyWeakref_IsDead(PyObject *ref)
9268
9369
Test if the weak reference *ref* is dead. Returns 1 if the reference is

Doc/data/refcounts.dat

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2947,12 +2947,6 @@ PyWeakref_CheckProxy:PyObject*:ob:0:
29472947
PyWeakref_CheckRef:int:::
29482948
PyWeakref_CheckRef:PyObject*:ob:0:
29492949

2950-
PyWeakref_GET_OBJECT:PyObject*::0:
2951-
PyWeakref_GET_OBJECT:PyObject*:ref:0:
2952-
2953-
PyWeakref_GetObject:PyObject*::0:
2954-
PyWeakref_GetObject:PyObject*:ref:0:
2955-
29562950
PyWeakref_GetRef:int:::
29572951
PyWeakref_GetRef:PyObject*:ref:0:
29582952
PyWeakref_GetRef:PyObject**:pobj:+1:

Doc/data/stable_abi.dat

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Doc/deprecations/c-api-pending-removal-in-3.15.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Pending removal in Python 3.15
33

44
* The :c:func:`!PyImport_ImportModuleNoBlock`:
55
Use :c:func:`PyImport_ImportModule` instead.
6-
* :c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`:
6+
* :c:func:`!PyWeakref_GetObject` and :c:func:`!PyWeakref_GET_OBJECT`:
77
Use :c:func:`PyWeakref_GetRef` instead. The `pythoncapi-compat project
88
<https://github.com/python/pythoncapi-compat/>`__ can be used to get
99
:c:func:`PyWeakref_GetRef` on Python 3.12 and older.

Doc/howto/free-threading-extensions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ that return :term:`strong references <strong reference>`.
173173
+-----------------------------------+-----------------------------------+
174174
| :c:func:`PyDict_Next` | none (see :ref:`PyDict_Next`) |
175175
+-----------------------------------+-----------------------------------+
176-
| :c:func:`PyWeakref_GetObject` | :c:func:`PyWeakref_GetRef` |
176+
| :c:func:`!PyWeakref_GetObject` | :c:func:`PyWeakref_GetRef` |
177177
+-----------------------------------+-----------------------------------+
178-
| :c:func:`PyWeakref_GET_OBJECT` | :c:func:`PyWeakref_GetRef` |
178+
| :c:func:`!PyWeakref_GET_OBJECT` | :c:func:`PyWeakref_GetRef` |
179179
+-----------------------------------+-----------------------------------+
180180
| :c:func:`PyImport_AddModule` | :c:func:`PyImport_AddModuleRef` |
181181
+-----------------------------------+-----------------------------------+

Doc/library/codecs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ particular, the following variants typically exist:
13391339
+-----------------+--------------------------------+--------------------------------+
13401340
| utf_8 | U8, UTF, utf8, cp65001 | all languages |
13411341
+-----------------+--------------------------------+--------------------------------+
1342-
| utf_8_sig | | all languages |
1342+
| utf_8_sig | utf8-sig | all languages |
13431343
+-----------------+--------------------------------+--------------------------------+
13441344

13451345
.. versionchanged:: 3.4

Doc/library/collections.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,11 @@ Several mathematical operations are provided for combining :class:`Counter`
367367
objects to produce multisets (counters that have counts greater than zero).
368368
Addition and subtraction combine counters by adding or subtracting the counts
369369
of corresponding elements. Intersection and union return the minimum and
370-
maximum of corresponding counts. Equality and inclusion compare
371-
corresponding counts. Each operation can accept inputs with signed
372-
counts, but the output will exclude results with counts of zero or less.
370+
maximum of corresponding counts. Symmetric difference returns the difference
371+
between the maximum and minimum of the corresponding counts. Equality and
372+
inclusion compare corresponding counts. Each operation can accept inputs
373+
with signed counts, but the output will exclude results with counts of zero
374+
or below.
373375

374376
.. doctest::
375377

@@ -383,6 +385,8 @@ counts, but the output will exclude results with counts of zero or less.
383385
Counter({'a': 1, 'b': 1})
384386
>>> c | d # union: max(c[x], d[x])
385387
Counter({'a': 3, 'b': 2})
388+
>>> c ^ d # max(c[x], d[x]) - min(c[x], d[x])
389+
Counter({'a': 2, 'b': 1})
386390
>>> c == d # equality: c[x] == d[x]
387391
False
388392
>>> c <= d # inclusion: c[x] <= d[x]
@@ -400,6 +404,9 @@ or subtracting from an empty counter.
400404
.. versionadded:: 3.3
401405
Added support for unary plus, unary minus, and in-place multiset operations.
402406

407+
.. versionadded:: next
408+
Added support for the symmetric difference multiset operation, ``c ^ d``.
409+
403410
.. note::
404411

405412
Counters were primarily designed to work with positive integers to represent

Doc/library/datetime.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,9 @@ Other constructors, all class methods:
535535
:c:func:`localtime` function. Raise :exc:`OSError` instead of
536536
:exc:`ValueError` on :c:func:`localtime` failure.
537537

538+
.. versionchanged:: next
539+
Accepts any real number as *timestamp*, not only integer or float.
540+
538541

539542
.. classmethod:: date.fromordinal(ordinal)
540543

@@ -1020,6 +1023,10 @@ Other constructors, all class methods:
10201023
.. versionchanged:: 3.6
10211024
:meth:`fromtimestamp` may return instances with :attr:`.fold` set to 1.
10221025

1026+
.. versionchanged:: next
1027+
Accepts any real number as *timestamp*, not only integer or float.
1028+
1029+
10231030
.. classmethod:: datetime.utcfromtimestamp(timestamp)
10241031

10251032
Return the UTC :class:`.datetime` corresponding to the POSIX timestamp, with
@@ -1060,6 +1067,9 @@ Other constructors, all class methods:
10601067

10611068
Use :meth:`datetime.fromtimestamp` with :const:`UTC` instead.
10621069

1070+
.. versionchanged:: next
1071+
Accepts any real number as *timestamp*, not only integer or float.
1072+
10631073

10641074
.. classmethod:: datetime.fromordinal(ordinal)
10651075

Doc/library/os.rst

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2017,8 +2017,8 @@ features:
20172017
must be a string specifying a file path. However, some functions now
20182018
alternatively accept an open file descriptor for their *path* argument.
20192019
The function will then operate on the file referred to by the descriptor.
2020-
(For POSIX systems, Python will call the variant of the function prefixed
2021-
with ``f`` (e.g. call ``fchdir`` instead of ``chdir``).)
2020+
For POSIX systems, Python will call the variant of the function prefixed
2021+
with ``f`` (e.g. call ``fchdir`` instead of ``chdir``).
20222022

20232023
You can check whether or not *path* can be specified as a file descriptor
20242024
for a particular function on your platform using :data:`os.supports_fd`.
@@ -2033,7 +2033,7 @@ features:
20332033
* **paths relative to directory descriptors:** If *dir_fd* is not ``None``, it
20342034
should be a file descriptor referring to a directory, and the path to operate
20352035
on should be relative; path will then be relative to that directory. If the
2036-
path is absolute, *dir_fd* is ignored. (For POSIX systems, Python will call
2036+
path is absolute, *dir_fd* is ignored. For POSIX systems, Python will call
20372037
the variant of the function with an ``at`` suffix and possibly prefixed with
20382038
``f`` (e.g. call ``faccessat`` instead of ``access``).
20392039

@@ -2046,8 +2046,8 @@ features:
20462046
* **not following symlinks:** If *follow_symlinks* is
20472047
``False``, and the last element of the path to operate on is a symbolic link,
20482048
the function will operate on the symbolic link itself rather than the file
2049-
pointed to by the link. (For POSIX systems, Python will call the ``l...``
2050-
variant of the function.)
2049+
pointed to by the link. For POSIX systems, Python will call the ``l...``
2050+
variant of the function.
20512051

20522052
You can check whether or not *follow_symlinks* is supported for a particular
20532053
function on your platform using :data:`os.supports_follow_symlinks`.
@@ -3618,7 +3618,8 @@ features:
36183618
where each member is an int expressing nanoseconds.
36193619
- If *times* is not ``None``,
36203620
it must be a 2-tuple of the form ``(atime, mtime)``
3621-
where each member is an int or float expressing seconds.
3621+
where each member is a real number expressing seconds,
3622+
rounded down to nanoseconds.
36223623
- If *times* is ``None`` and *ns* is unspecified,
36233624
this is equivalent to specifying ``ns=(atime_ns, mtime_ns)``
36243625
where both times are the current time.
@@ -3645,6 +3646,9 @@ features:
36453646
.. versionchanged:: 3.6
36463647
Accepts a :term:`path-like object`.
36473648

3649+
.. versionchanged:: next
3650+
Accepts any real numbers as *times*, not only integers or floats.
3651+
36483652

36493653
.. function:: walk(top, topdown=True, onerror=None, followlinks=False)
36503654

@@ -4050,7 +4054,7 @@ Naturally, they are all only available on Linux.
40504054
the timer will fire when the timer's clock
40514055
(set by *clockid* in :func:`timerfd_create`) reaches *initial* seconds.
40524056

4053-
The timer's interval is set by the *interval* :py:class:`float`.
4057+
The timer's interval is set by the *interval* real number.
40544058
If *interval* is zero, the timer only fires once, on the initial expiration.
40554059
If *interval* is greater than zero, the timer fires every time *interval*
40564060
seconds have elapsed since the previous expiration.

0 commit comments

Comments
 (0)