Skip to content

Commit 0279948

Browse files
committed
Deploying to gh-pages from @ 120023f 🚀
1 parent 36bca28 commit 0279948

File tree

675 files changed

+24681
-12326
lines changed

Some content is hidden

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

675 files changed

+24681
-12326
lines changed

.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 027112e6b110a6ec310dc8c74832cccb
3+
config: f87e8867697d38f9afc2009f0655d1bc
44
tags: b5e2c454ba7771976391ed0cecdde553

_sources/c-api/apiabiversion.rst.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ See :ref:`stable` for a discussion of API and ABI stability across versions.
4646
Use this for numeric comparisons, for example,
4747
``#if PY_VERSION_HEX >= ...``.
4848

49+
These macros are defined in :source:`Include/patchlevel.h`.
50+
4951

5052
Run-time version
5153
----------------

_sources/c-api/call.rst.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,8 @@ please see individual documentation for details.
347347
348348
.. versionadded:: 3.9
349349
350+
.. c:function:: PyObject* _PyObject_Vectorcall(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames)
351+
:no-typesetting:
350352
351353
.. c:function:: PyObject* PyObject_Vectorcall(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwnames)
352354
@@ -358,7 +360,12 @@ please see individual documentation for details.
358360
Return the result of the call on success, or raise an exception and return
359361
*NULL* on failure.
360362
361-
.. versionadded:: 3.9
363+
.. versionadded:: 3.8 as ``_PyObject_Vectorcall``
364+
365+
.. versionchanged:: 3.9
366+
367+
Renamed to the current name, without the leading underscore.
368+
The old provisional name is :term:`soft deprecated`.
362369
363370
.. c:function:: PyObject* PyObject_VectorcallDict(PyObject *callable, PyObject *const *args, size_t nargsf, PyObject *kwdict)
364371

_sources/c-api/code.rst.txt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,14 @@ bound into a function.
6969
The old name is deprecated, but will remain available until the
7070
signature changes again.
7171
72+
.. c:function:: PyCodeObject* PyCode_NewWithPosOnlyArgs(...)
73+
:no-typesetting:
74+
7275
.. c:function:: PyCodeObject* PyUnstable_Code_NewWithPosOnlyArgs(int argcount, int posonlyargcount, int kwonlyargcount, int nlocals, int stacksize, int flags, PyObject *code, PyObject *consts, PyObject *names, PyObject *varnames, PyObject *freevars, PyObject *cellvars, PyObject *filename, PyObject *name, PyObject *qualname, int firstlineno, PyObject *linetable, PyObject *exceptiontable)
7376
7477
Similar to :c:func:`PyUnstable_Code_New`, but with an extra "posonlyargcount" for positional-only arguments.
7578
The same caveats that apply to ``PyUnstable_Code_New`` also apply to this function.
7679
77-
.. index:: single: PyCode_NewWithPosOnlyArgs (C function)
78-
7980
.. versionadded:: 3.8 as ``PyCode_NewWithPosOnlyArgs``
8081
8182
.. versionchanged:: 3.11
@@ -298,6 +299,9 @@ These functions are part of the unstable C API tier:
298299
this functionality is a CPython implementation detail, and the API
299300
may change without deprecation warnings.
300301
302+
.. c:function:: Py_ssize_t _PyEval_RequestCodeExtraIndex(freefunc free)
303+
:no-typesetting:
304+
301305
.. c:function:: Py_ssize_t PyUnstable_Eval_RequestCodeExtraIndex(freefunc free)
302306
303307
Return a new opaque index value used to adding data to code objects.
@@ -310,8 +314,6 @@ may change without deprecation warnings.
310314
*free* will be called on non-``NULL`` data stored under the new index.
311315
Use :c:func:`Py_DecRef` when storing :c:type:`PyObject`.
312316
313-
.. index:: single: _PyEval_RequestCodeExtraIndex (C function)
314-
315317
.. versionadded:: 3.6 as ``_PyEval_RequestCodeExtraIndex``
316318
317319
.. versionchanged:: 3.12
@@ -320,6 +322,9 @@ may change without deprecation warnings.
320322
The old private name is deprecated, but will be available until the API
321323
changes.
322324
325+
.. c:function:: int _PyCode_GetExtra(PyObject *code, Py_ssize_t index, void **extra)
326+
:no-typesetting:
327+
323328
.. c:function:: int PyUnstable_Code_GetExtra(PyObject *code, Py_ssize_t index, void **extra)
324329
325330
Set *extra* to the extra data stored under the given index.
@@ -328,8 +333,6 @@ may change without deprecation warnings.
328333
If no data was set under the index, set *extra* to ``NULL`` and return
329334
0 without setting an exception.
330335
331-
.. index:: single: _PyCode_GetExtra (C function)
332-
333336
.. versionadded:: 3.6 as ``_PyCode_GetExtra``
334337
335338
.. versionchanged:: 3.12
@@ -338,13 +341,14 @@ may change without deprecation warnings.
338341
The old private name is deprecated, but will be available until the API
339342
changes.
340343
344+
.. c:function:: int _PyCode_SetExtra(PyObject *code, Py_ssize_t index, void *extra)
345+
:no-typesetting:
346+
341347
.. c:function:: int PyUnstable_Code_SetExtra(PyObject *code, Py_ssize_t index, void *extra)
342348
343349
Set the extra data stored under the given index to *extra*.
344350
Return 0 on success. Set an exception and return -1 on failure.
345351
346-
.. index:: single: _PyCode_SetExtra (C function)
347-
348352
.. versionadded:: 3.6 as ``_PyCode_SetExtra``
349353
350354
.. versionchanged:: 3.12

_sources/c-api/conversion.rst.txt

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ The following functions provide locale-independent string to number conversions.
130130
131131
*flags* can be zero or more of the following values or-ed together:
132132
133+
.. c:namespace:: NULL
134+
133135
.. c:macro:: Py_DTSF_SIGN
134136
135137
Always precede the returned string with a sign
@@ -151,9 +153,21 @@ The following functions provide locale-independent string to number conversions.
151153
152154
.. versionadded:: 3.11
153155
154-
If *ptype* is non-``NULL``, then the value it points to will be set to one of
155-
``Py_DTST_FINITE``, ``Py_DTST_INFINITE``, or ``Py_DTST_NAN``, signifying that
156-
*val* is a finite number, an infinite number, or not a number, respectively.
156+
If *ptype* is non-``NULL``, then the value it points to will be set to one
157+
of the following constants depending on the type of *val*:
158+
159+
.. list-table::
160+
:header-rows: 1
161+
:align: left
162+
163+
* - *\*ptype*
164+
- type of *val*
165+
* - .. c:macro:: Py_DTST_FINITE
166+
- finite number
167+
* - .. c:macro:: Py_DTST_INFINITE
168+
- infinite number
169+
* - .. c:macro:: Py_DTST_NAN
170+
- not a number
157171
158172
The return value is a pointer to *buffer* with the converted string or
159173
``NULL`` if the conversion failed. The caller is responsible for freeing the
@@ -162,16 +176,33 @@ The following functions provide locale-independent string to number conversions.
162176
.. versionadded:: 3.1
163177
164178
165-
.. c:function:: int PyOS_stricmp(const char *s1, const char *s2)
179+
.. c:function:: int PyOS_mystricmp(const char *str1, const char *str2)
180+
int PyOS_mystrnicmp(const char *str1, const char *str2, Py_ssize_t size)
181+
182+
Case insensitive comparison of strings. These functions work almost
183+
identically to :c:func:`!strcmp` and :c:func:`!strncmp` (respectively),
184+
except that they ignore the case of ASCII characters.
185+
186+
Return ``0`` if the strings are equal, a negative value if *str1* sorts
187+
lexicographically before *str2*, or a positive value if it sorts after.
188+
189+
In the *str1* or *str2* arguments, a NUL byte marks the end of the string.
190+
For :c:func:`!PyOS_mystrnicmp`, the *size* argument gives the maximum size
191+
of the string, as if NUL was present at the index given by *size*.
192+
193+
These functions do not use the locale.
194+
166195
167-
Case insensitive comparison of strings. The function works almost
168-
identically to :c:func:`!strcmp` except that it ignores the case.
196+
.. c:function:: int PyOS_stricmp(const char *str1, const char *str2)
197+
int PyOS_strnicmp(const char *str1, const char *str2, Py_ssize_t size)
169198
199+
Case insensitive comparison of strings.
170200
171-
.. c:function:: int PyOS_strnicmp(const char *s1, const char *s2, Py_ssize_t size)
201+
On Windows, these are aliases of :c:func:`!stricmp` and :c:func:`!strnicmp`,
202+
respectively.
172203
173-
Case insensitive comparison of strings. The function works almost
174-
identically to :c:func:`!strncmp` except that it ignores the case.
204+
On other platforms, they are aliases of :c:func:`PyOS_mystricmp` and
205+
:c:func:`PyOS_mystrnicmp`, respectively.
175206
176207
177208
Character classification and conversion

_sources/c-api/descriptor.rst.txt

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,46 @@ found in the dictionary of type objects.
2121
.. c:function:: PyObject* PyDescr_NewMember(PyTypeObject *type, struct PyMemberDef *meth)
2222
2323
24+
.. c:var:: PyTypeObject PyMemberDescr_Type
25+
26+
The type object for member descriptor objects created from
27+
:c:type:`PyMemberDef` structures. These descriptors expose fields of a
28+
C struct as attributes on a type, and correspond
29+
to :class:`types.MemberDescriptorType` objects in Python.
30+
31+
32+
33+
.. c:var:: PyTypeObject PyGetSetDescr_Type
34+
35+
The type object for get/set descriptor objects created from
36+
:c:type:`PyGetSetDef` structures. These descriptors implement attributes
37+
whose value is computed by C getter and setter functions, and are used
38+
for many built-in type attributes.
39+
40+
2441
.. c:function:: PyObject* PyDescr_NewMethod(PyTypeObject *type, struct PyMethodDef *meth)
2542
2643
44+
.. c:var:: PyTypeObject PyMethodDescr_Type
45+
46+
The type object for method descriptor objects created from
47+
:c:type:`PyMethodDef` structures. These descriptors expose C functions as
48+
methods on a type, and correspond to :class:`types.MemberDescriptorType`
49+
objects in Python.
50+
51+
2752
.. c:function:: PyObject* PyDescr_NewWrapper(PyTypeObject *type, struct wrapperbase *wrapper, void *wrapped)
2853
2954
55+
.. c:var:: PyTypeObject PyWrapperDescr_Type
56+
57+
The type object for wrapper descriptor objects created by
58+
:c:func:`PyDescr_NewWrapper` and :c:func:`PyWrapper_New`. Wrapper
59+
descriptors are used internally to expose special methods implemented
60+
via wrapper structures, and appear in Python as
61+
:class:`types.WrapperDescriptorType` objects.
62+
63+
3064
.. c:function:: PyObject* PyDescr_NewClassMethod(PyTypeObject *type, PyMethodDef *method)
3165
3266
@@ -55,6 +89,14 @@ Built-in descriptors
5589
:class:`classmethod` in the Python layer.
5690
5791
92+
.. c:var:: PyTypeObject PyClassMethodDescr_Type
93+
94+
The type object for C-level class method descriptor objects.
95+
This is the type of the descriptors created for :func:`classmethod` defined in
96+
C extension types, and is the same object as :class:`classmethod`
97+
in Python.
98+
99+
58100
.. c:function:: PyObject *PyClassMethod_New(PyObject *callable)
59101
60102
Create a new :class:`classmethod` object wrapping *callable*.

_sources/c-api/dict.rst.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@ Dictionary Objects
4343
prevent modification of the dictionary for non-dynamic class types.
4444
4545
46+
.. c:var:: PyTypeObject PyDictProxy_Type
47+
48+
The type object for mapping proxy objects created by
49+
:c:func:`PyDictProxy_New` and for the read-only ``__dict__`` attribute
50+
of many built-in types. A :c:type:`PyDictProxy_Type` instance provides a
51+
dynamic, read-only view of an underlying dictionary: changes to the
52+
underlying dictionary are reflected in the proxy, but the proxy itself
53+
does not support mutation operations. This corresponds to
54+
:class:`types.MappingProxyType` in Python.
55+
56+
4657
.. c:function:: void PyDict_Clear(PyObject *p)
4758
4859
Empty an existing dictionary of all key-value pairs.

_sources/c-api/exceptions.rst.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,9 @@ because the :ref:`call protocol <call>` takes care of recursion handling.
984984
be concatenated to the :exc:`RecursionError` message caused by the recursion
985985
depth limit.
986986
987+
.. seealso::
988+
The :c:func:`PyUnstable_ThreadState_SetStackProtection` function.
989+
987990
.. versionchanged:: 3.9
988991
This function is now also available in the :ref:`limited API <limited-c-api>`.
989992

_sources/c-api/file.rst.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,22 @@ the :mod:`io` APIs instead.
131131
132132
Write string *s* to file object *p*. Return ``0`` on success or ``-1`` on
133133
failure; the appropriate exception will be set.
134+
135+
136+
Deprecated API
137+
^^^^^^^^^^^^^^
138+
139+
140+
These are :term:`soft deprecated` APIs that were included in Python's C API
141+
by mistake. They are documented solely for completeness; use other
142+
``PyFile*`` APIs instead.
143+
144+
.. c:function:: PyObject *PyFile_NewStdPrinter(int fd)
145+
146+
Use :c:func:`PyFile_FromFd` with defaults (``fd, NULL, "w", -1, NULL, NULL, NULL, 0``) instead.
147+
148+
.. c:var:: PyTypeObject PyStdPrinter_Type
149+
150+
Type of file-like objects used internally at Python startup when :py:mod:`io` is
151+
not yet available.
152+
Use Python :py:func:`open` or :c:func:`PyFile_FromFd` to create file objects instead.

_sources/c-api/gcsupport.rst.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ The :c:member:`~PyTypeObject.tp_traverse` handler must have the following type:
232232
object argument. If *visit* returns a non-zero value that value should be
233233
returned immediately.
234234
235+
The traversal function must not have any side effects. Implementations
236+
may not modify the reference counts of any Python objects nor create or
237+
destroy any Python objects.
238+
235239
To simplify writing :c:member:`~PyTypeObject.tp_traverse` handlers, a :c:func:`Py_VISIT` macro is
236240
provided. In order to use this macro, the :c:member:`~PyTypeObject.tp_traverse` implementation
237241
must name its arguments exactly *visit* and *arg*:

0 commit comments

Comments
 (0)