Skip to content

Commit 9f5dcf0

Browse files
committed
Deploying to gh-pages from @ 19f27b6 🚀
1 parent a15008a commit 9f5dcf0

File tree

692 files changed

+16744
-26771
lines changed

Some content is hidden

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

692 files changed

+16744
-26771
lines changed

.buildinfo

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: cb10d30bafb08cf1c216562b1e263843
3+
config: ebde486aee4448326d1f3cc4a37b7067
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

_sources/c-api/arg.rst.txt

+5-42
Original file line numberDiff line numberDiff line change
@@ -136,48 +136,6 @@ which disallows mutable objects such as :class:`bytearray`.
136136
attempting any conversion. Raises :exc:`TypeError` if the object is not
137137
a :class:`bytearray` object. The C variable may also be declared as :c:expr:`PyObject*`.
138138

139-
``u`` (:class:`str`) [const Py_UNICODE \*]
140-
Convert a Python Unicode object to a C pointer to a NUL-terminated buffer of
141-
Unicode characters. You must pass the address of a :c:type:`Py_UNICODE`
142-
pointer variable, which will be filled with the pointer to an existing
143-
Unicode buffer. Please note that the width of a :c:type:`Py_UNICODE`
144-
character depends on compilation options (it is either 16 or 32 bits).
145-
The Python string must not contain embedded null code points; if it does,
146-
a :exc:`ValueError` exception is raised.
147-
148-
.. versionchanged:: 3.5
149-
Previously, :exc:`TypeError` was raised when embedded null code points
150-
were encountered in the Python string.
151-
152-
.. deprecated-removed:: 3.3 3.12
153-
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
154-
:c:func:`PyUnicode_AsWideCharString`.
155-
156-
``u#`` (:class:`str`) [const Py_UNICODE \*, :c:type:`Py_ssize_t`]
157-
This variant on ``u`` stores into two C variables, the first one a pointer to a
158-
Unicode data buffer, the second one its length. This variant allows
159-
null code points.
160-
161-
.. deprecated-removed:: 3.3 3.12
162-
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
163-
:c:func:`PyUnicode_AsWideCharString`.
164-
165-
``Z`` (:class:`str` or ``None``) [const Py_UNICODE \*]
166-
Like ``u``, but the Python object may also be ``None``, in which case the
167-
:c:type:`Py_UNICODE` pointer is set to ``NULL``.
168-
169-
.. deprecated-removed:: 3.3 3.12
170-
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
171-
:c:func:`PyUnicode_AsWideCharString`.
172-
173-
``Z#`` (:class:`str` or ``None``) [const Py_UNICODE \*, :c:type:`Py_ssize_t`]
174-
Like ``u#``, but the Python object may also be ``None``, in which case the
175-
:c:type:`Py_UNICODE` pointer is set to ``NULL``.
176-
177-
.. deprecated-removed:: 3.3 3.12
178-
Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using
179-
:c:func:`PyUnicode_AsWideCharString`.
180-
181139
``U`` (:class:`str`) [PyObject \*]
182140
Requires that the Python object is a Unicode object, without attempting
183141
any conversion. Raises :exc:`TypeError` if the object is not a Unicode
@@ -247,6 +205,11 @@ which disallows mutable objects such as :class:`bytearray`.
247205
them. Instead, the implementation assumes that the byte string object uses the
248206
encoding passed in as parameter.
249207

208+
.. versionchanged:: 3.12
209+
``u``, ``u#``, ``Z``, and ``Z#`` are removed because they used a legacy
210+
``Py_UNICODE*`` representation.
211+
212+
250213
Numbers
251214
-------
252215

_sources/c-api/bytes.rst.txt

-3
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ called with a non-bytes parameter.
5858
5959
.. % XXX: This should be exactly the same as the table in PyErr_Format.
6060
.. % One should just refer to the other.
61-
.. % XXX: The descriptions for %zd and %zu are wrong, but the truth is complicated
62-
.. % because not all compilers support the %z width modifier -- we fake it
63-
.. % when necessary via interpolating PY_FORMAT_SIZE_T.
6461
6562
.. tabularcolumns:: |l|l|L|
6663

_sources/c-api/call.rst.txt

+9
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ This bears repeating:
5757
A class supporting vectorcall **must** also implement
5858
:c:member:`~PyTypeObject.tp_call` with the same semantics.
5959

60+
.. versionchanged:: 3.12
61+
62+
The :const:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class
63+
when the class's :py:meth:`~object.__call__` method is reassigned.
64+
(This internally sets :c:member:`~PyTypeObject.tp_call` only, and thus
65+
may make it behave differently than the vectorcall function.)
66+
In earlier Python versions, vectorcall should only be used with
67+
:const:`immutable <Py_TPFLAGS_IMMUTABLETYPE>` or static types.
68+
6069
A class should not implement vectorcall if that would be slower
6170
than *tp_call*. For example, if the callee needs to convert
6271
the arguments to an args tuple and kwargs dict anyway, then there is no point

_sources/c-api/dict.rst.txt

+70
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,73 @@ Dictionary Objects
238238
for key, value in seq2:
239239
if override or key not in a:
240240
a[key] = value
241+
242+
.. c:function:: int PyDict_AddWatcher(PyDict_WatchCallback callback)
243+
244+
Register *callback* as a dictionary watcher. Return a non-negative integer
245+
id which must be passed to future calls to :c:func:`PyDict_Watch`. In case
246+
of error (e.g. no more watcher IDs available), return ``-1`` and set an
247+
exception.
248+
249+
.. versionadded:: 3.12
250+
251+
.. c:function:: int PyDict_ClearWatcher(int watcher_id)
252+
253+
Clear watcher identified by *watcher_id* previously returned from
254+
:c:func:`PyDict_AddWatcher`. Return ``0`` on success, ``-1`` on error (e.g.
255+
if the given *watcher_id* was never registered.)
256+
257+
.. versionadded:: 3.12
258+
259+
.. c:function:: int PyDict_Watch(int watcher_id, PyObject *dict)
260+
261+
Mark dictionary *dict* as watched. The callback granted *watcher_id* by
262+
:c:func:`PyDict_AddWatcher` will be called when *dict* is modified or
263+
deallocated. Return ``0`` on success or ``-1`` on error.
264+
265+
.. versionadded:: 3.12
266+
267+
.. c:function:: int PyDict_Unwatch(int watcher_id, PyObject *dict)
268+
269+
Mark dictionary *dict* as no longer watched. The callback granted
270+
*watcher_id* by :c:func:`PyDict_AddWatcher` will no longer be called when
271+
*dict* is modified or deallocated. The dict must previously have been
272+
watched by this watcher. Return ``0`` on success or ``-1`` on error.
273+
274+
.. versionadded:: 3.12
275+
276+
.. c:type:: PyDict_WatchEvent
277+
278+
Enumeration of possible dictionary watcher events: ``PyDict_EVENT_ADDED``,
279+
``PyDict_EVENT_MODIFIED``, ``PyDict_EVENT_DELETED``, ``PyDict_EVENT_CLONED``,
280+
``PyDict_EVENT_CLEARED``, or ``PyDict_EVENT_DEALLOCATED``.
281+
282+
.. versionadded:: 3.12
283+
284+
.. c:type:: int (*PyDict_WatchCallback)(PyDict_WatchEvent event, PyObject *dict, PyObject *key, PyObject *new_value)
285+
286+
Type of a dict watcher callback function.
287+
288+
If *event* is ``PyDict_EVENT_CLEARED`` or ``PyDict_EVENT_DEALLOCATED``, both
289+
*key* and *new_value* will be ``NULL``. If *event* is ``PyDict_EVENT_ADDED``
290+
or ``PyDict_EVENT_MODIFIED``, *new_value* will be the new value for *key*.
291+
If *event* is ``PyDict_EVENT_DELETED``, *key* is being deleted from the
292+
dictionary and *new_value* will be ``NULL``.
293+
294+
``PyDict_EVENT_CLONED`` occurs when *dict* was previously empty and another
295+
dict is merged into it. To maintain efficiency of this operation, per-key
296+
``PyDict_EVENT_ADDED`` events are not issued in this case; instead a
297+
single ``PyDict_EVENT_CLONED`` is issued, and *key* will be the source
298+
dictionary.
299+
300+
The callback may inspect but must not modify *dict*; doing so could have
301+
unpredictable effects, including infinite recursion.
302+
303+
Callbacks occur before the notified modification to *dict* takes place, so
304+
the prior state of *dict* can be inspected.
305+
306+
If the callback returns with an exception set, it must return ``-1``; this
307+
exception will be printed as an unraisable exception using
308+
:c:func:`PyErr_WriteUnraisable`. Otherwise it should return ``0``.
309+
310+
.. versionadded:: 3.12

_sources/c-api/function.rst.txt

+9
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,15 @@ There are a few functions specific to Python functions.
8383
Raises :exc:`SystemError` and returns ``-1`` on failure.
8484
8585
86+
.. c:function:: void PyFunction_SetVectorcall(PyFunctionObject *func, vectorcallfunc vectorcall)
87+
88+
Set the vectorcall field of a given function object *func*.
89+
90+
Warning: extensions using this API must preserve the behavior
91+
of the unaltered (default) vectorcall function!
92+
93+
.. versionadded:: 3.12
94+
8695
.. c:function:: PyObject* PyFunction_GetClosure(PyObject *op)
8796
8897
Return the closure associated with the function object *op*. This can be ``NULL``

_sources/c-api/import.rst.txt

+9
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ Importing Modules
150150
See also :c:func:`PyImport_ExecCodeModuleEx` and
151151
:c:func:`PyImport_ExecCodeModuleWithPathnames`.
152152
153+
.. versionchanged:: 3.12
154+
The setting of :attr:`__cached__` and :attr:`__loader__` is
155+
deprecated. See :class:`~importlib.machinery.ModuleSpec` for
156+
alternatives.
157+
153158
154159
.. c:function:: PyObject* PyImport_ExecCodeModuleEx(const char *name, PyObject *co, const char *pathname)
155160
@@ -167,6 +172,10 @@ Importing Modules
167172
168173
.. versionadded:: 3.3
169174
175+
.. versionchanged:: 3.12
176+
Setting :attr:`__cached__` is deprecated. See
177+
:class:`~importlib.machinery.ModuleSpec` for alternatives.
178+
170179
171180
.. c:function:: PyObject* PyImport_ExecCodeModuleWithPathnames(const char *name, PyObject *co, const char *pathname, const char *cpathname)
172181

0 commit comments

Comments
 (0)