Skip to content

Commit 3230ecc

Browse files
authored
Merge branch 'main' into gh-145779-classmethod-staticmethod-scaling
2 parents 5a35c20 + 1efd993 commit 3230ecc

File tree

215 files changed

+7121
-4467
lines changed

Some content is hidden

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

215 files changed

+7121
-4467
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ updates:
1212
update-types:
1313
- "version-update:semver-minor"
1414
- "version-update:semver-patch"
15+
groups:
16+
actions:
17+
patterns:
18+
- "*"
1519
cooldown:
1620
# https://blog.yossarian.net/2025/11/21/We-should-all-be-using-dependency-cooldowns
1721
# Cooldowns protect against supply chain attacks by avoiding the

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ jobs:
475475
-x test_subprocess \
476476
-x test_signal \
477477
-x test_sysconfig
478-
- uses: actions/upload-artifact@v6
478+
- uses: actions/upload-artifact@v7
479479
if: always()
480480
with:
481481
name: hypothesis-example-db

.github/workflows/reusable-check-c-api-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
runs-on: ubuntu-latest
1616
timeout-minutes: 5
1717
steps:
18-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@v6
1919
with:
2020
persist-credentials: false
21-
- uses: actions/setup-python@v5
21+
- uses: actions/setup-python@v6
2222
with:
2323
python-version: '3.x'
2424
- name: Check for undocumented C APIs

.github/workflows/reusable-cifuzz.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
sanitizer: ${{ inputs.sanitizer }}
3535
- name: Upload crash
3636
if: failure() && steps.build.outcome == 'success'
37-
uses: actions/upload-artifact@v6
37+
uses: actions/upload-artifact@v7
3838
with:
3939
name: ${{ inputs.sanitizer }}-artifacts
4040
path: ./out/artifacts

.github/workflows/reusable-san.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
run: find "${GITHUB_WORKSPACE}" -name 'san_log.*' | xargs head -n 1000
9797
- name: Archive logs
9898
if: always()
99-
uses: actions/upload-artifact@v6
99+
uses: actions/upload-artifact@v7
100100
with:
101101
name: >-
102102
${{ inputs.sanitizer }}-logs-${{

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
steps:
1616
- name: "Check PRs"
17-
uses: actions/stale@v9
17+
uses: actions/stale@v10
1818
with:
1919
repo-token: ${{ secrets.GITHUB_TOKEN }}
2020
stale-pr-message: 'This PR is stale because it has been open for 30 days with no activity.'

Doc/c-api/bytes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,13 +371,17 @@ Getters
371371
372372
Get the writer size.
373373
374+
The function cannot fail.
375+
374376
.. c:function:: void* PyBytesWriter_GetData(PyBytesWriter *writer)
375377
376378
Get the writer data: start of the internal buffer.
377379
378380
The pointer is valid until :c:func:`PyBytesWriter_Finish` or
379381
:c:func:`PyBytesWriter_Discard` is called on *writer*.
380382
383+
The function cannot fail.
384+
381385
382386
Low-level API
383387
^^^^^^^^^^^^^

Doc/c-api/dict.rst

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ Dictionary objects
4242
enforces read-only behavior. This is normally used to create a view to
4343
prevent modification of the dictionary for non-dynamic class types.
4444
45+
The first argument can be a :class:`dict`, a :class:`frozendict`, or a
46+
mapping.
47+
48+
.. versionchanged:: next
49+
Also accept :class:`frozendict`.
50+
4551
4652
.. c:var:: PyTypeObject PyDictProxy_Type
4753
@@ -68,15 +74,25 @@ Dictionary objects
6874
*key*, return ``1``, otherwise return ``0``. On error, return ``-1``.
6975
This is equivalent to the Python expression ``key in p``.
7076
77+
The first argument can be a :class:`dict` or a :class:`frozendict`.
78+
79+
.. versionchanged:: next
80+
Also accept :class:`frozendict`.
81+
7182
7283
.. c:function:: int PyDict_ContainsString(PyObject *p, const char *key)
7384
7485
This is the same as :c:func:`PyDict_Contains`, but *key* is specified as a
7586
:c:expr:`const char*` UTF-8 encoded bytes string, rather than a
7687
:c:expr:`PyObject*`.
7788
89+
The first argument can be a :class:`dict` or a :class:`frozendict`.
90+
7891
.. versionadded:: 3.13
7992
93+
.. versionchanged:: next
94+
Also accept :class:`frozendict`.
95+
8096
8197
.. c:function:: PyObject* PyDict_Copy(PyObject *p)
8298
@@ -122,8 +138,13 @@ Dictionary objects
122138
* If the key is missing, set *\*result* to ``NULL`` and return ``0``.
123139
* On error, raise an exception and return ``-1``.
124140
141+
The first argument can be a :class:`dict` or a :class:`frozendict`.
142+
125143
.. versionadded:: 3.13
126144
145+
.. versionchanged:: next
146+
Also accept :class:`frozendict`.
147+
127148
See also the :c:func:`PyObject_GetItem` function.
128149
129150
@@ -133,6 +154,8 @@ Dictionary objects
133154
has a key *key*. Return ``NULL`` if the key *key* is missing *without*
134155
setting an exception.
135156
157+
The first argument can be a :class:`dict` or a :class:`frozendict`.
158+
136159
.. note::
137160
138161
Exceptions that occur while this calls :meth:`~object.__hash__` and
@@ -143,6 +166,9 @@ Dictionary objects
143166
Calling this API without an :term:`attached thread state` had been allowed for historical
144167
reason. It is no longer allowed.
145168
169+
.. versionchanged:: next
170+
Also accept :class:`frozendict`.
171+
146172
147173
.. c:function:: PyObject* PyDict_GetItemWithError(PyObject *p, PyObject *key)
148174
@@ -151,6 +177,9 @@ Dictionary objects
151177
occurred. Return ``NULL`` **without** an exception set if the key
152178
wasn't present.
153179
180+
.. versionchanged:: next
181+
Also accept :class:`frozendict`.
182+
154183
155184
.. c:function:: PyObject* PyDict_GetItemString(PyObject *p, const char *key)
156185
@@ -166,6 +195,9 @@ Dictionary objects
166195
Prefer using the :c:func:`PyDict_GetItemWithError` function with your own
167196
:c:func:`PyUnicode_FromString` *key* instead.
168197
198+
.. versionchanged:: next
199+
Also accept :class:`frozendict`.
200+
169201
170202
.. c:function:: int PyDict_GetItemStringRef(PyObject *p, const char *key, PyObject **result)
171203
@@ -175,6 +207,9 @@ Dictionary objects
175207
176208
.. versionadded:: 3.13
177209
210+
.. versionchanged:: next
211+
Also accept :class:`frozendict`.
212+
178213
179214
.. c:function:: PyObject* PyDict_SetDefault(PyObject *p, PyObject *key, PyObject *defaultobj)
180215
@@ -238,17 +273,32 @@ Dictionary objects
238273
239274
Return a :c:type:`PyListObject` containing all the items from the dictionary.
240275
276+
The first argument can be a :class:`dict` or a :class:`frozendict`.
277+
278+
.. versionchanged:: next
279+
Also accept :class:`frozendict`.
280+
241281
242282
.. c:function:: PyObject* PyDict_Keys(PyObject *p)
243283
244284
Return a :c:type:`PyListObject` containing all the keys from the dictionary.
245285
286+
The first argument can be a :class:`dict` or a :class:`frozendict`.
287+
288+
.. versionchanged:: next
289+
Also accept :class:`frozendict`.
290+
246291
247292
.. c:function:: PyObject* PyDict_Values(PyObject *p)
248293
249294
Return a :c:type:`PyListObject` containing all the values from the dictionary
250295
*p*.
251296
297+
The first argument can be a :class:`dict` or a :class:`frozendict`.
298+
299+
.. versionchanged:: next
300+
Also accept :class:`frozendict`.
301+
252302
253303
.. c:function:: Py_ssize_t PyDict_Size(PyObject *p)
254304
@@ -257,11 +307,19 @@ Dictionary objects
257307
Return the number of items in the dictionary. This is equivalent to
258308
``len(p)`` on a dictionary.
259309
310+
The argument can be a :class:`dict` or a :class:`frozendict`.
311+
312+
.. versionchanged:: next
313+
Also accept :class:`frozendict`.
314+
260315
261316
.. c:function:: Py_ssize_t PyDict_GET_SIZE(PyObject *p)
262317
263318
Similar to :c:func:`PyDict_Size`, but without error checking.
264319
320+
.. versionchanged:: next
321+
Also accept :class:`frozendict`.
322+
265323
266324
.. c:function:: int PyDict_Next(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue)
267325
@@ -276,6 +334,8 @@ Dictionary objects
276334
value represents offsets within the internal dictionary structure, and
277335
since the structure is sparse, the offsets are not consecutive.
278336
337+
The first argument can be a :class:`dict` or a :class:`frozendict`.
338+
279339
For example::
280340
281341
PyObject *key, *value;
@@ -309,7 +369,7 @@ Dictionary objects
309369
}
310370
311371
The function is not thread-safe in the :term:`free-threaded <free threading>`
312-
build without external synchronization. You can use
372+
build without external synchronization for a mutable :class:`dict`. You can use
313373
:c:macro:`Py_BEGIN_CRITICAL_SECTION` to lock the dictionary while iterating
314374
over it::
315375
@@ -319,6 +379,8 @@ Dictionary objects
319379
}
320380
Py_END_CRITICAL_SECTION();
321381
382+
The function is thread-safe on a :class:`frozendict`.
383+
322384
.. note::
323385
324386
On the free-threaded build, this function can be used safely inside a
@@ -329,6 +391,9 @@ Dictionary objects
329391
:term:`strong reference <strong reference>` (for example, using
330392
:c:func:`Py_NewRef`).
331393
394+
.. versionchanged:: next
395+
Also accept :class:`frozendict`.
396+
332397
.. c:function:: int PyDict_Merge(PyObject *a, PyObject *b, int override)
333398
334399
Iterate over mapping object *b* adding key-value pairs to dictionary *a*.

Doc/c-api/float.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ NaNs (if such things exist on the platform) isn't handled correctly, and
201201
attempting to unpack a bytes string containing an IEEE INF or NaN will raise an
202202
exception.
203203
204-
Note that NaNs type may not be preserved on IEEE platforms (signaling NaN become
205-
quiet NaN), for example on x86 systems in 32-bit mode.
204+
Note that NaN type may not be preserved on IEEE platforms (signaling NaNs become
205+
quiet NaNs), for example on x86 systems in 32-bit mode.
206206
207207
On non-IEEE platforms with more precision, or larger dynamic range, than IEEE
208208
754 supports, not all values can be packed; on non-IEEE platforms with less
@@ -216,7 +216,7 @@ Pack functions
216216
217217
The pack routines write 2, 4 or 8 bytes, starting at *p*. *le* is an
218218
:c:expr:`int` argument, non-zero if you want the bytes string in little-endian
219-
format (exponent last, at ``p+1``, ``p+3``, or ``p+6`` ``p+7``), zero if you
219+
format (exponent last, at ``p+1``, ``p+3``, or ``p+6`` and ``p+7``), zero if you
220220
want big-endian format (exponent first, at *p*). The :c:macro:`PY_BIG_ENDIAN`
221221
constant can be used to use the native endian: it is equal to ``1`` on big
222222
endian processor, or ``0`` on little endian processor.

Doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@
569569
# Relative filename of the data files
570570
refcount_file = 'data/refcounts.dat'
571571
stable_abi_file = 'data/stable_abi.dat'
572+
threadsafety_file = 'data/threadsafety.dat'
572573

573574
# Options for sphinxext-opengraph
574575
# -------------------------------

0 commit comments

Comments
 (0)