Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 889e46e

Browse files
committed
Merge branch 'main' into sphinx-3-c-types
# Conflicts: # Doc/c-api/dict.rst # Doc/c-api/init.rst # Doc/c-api/marshal.rst
2 parents 4849512 + 77f0249 commit 889e46e

File tree

186 files changed

+52218
-8486
lines changed

Some content is hidden

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

186 files changed

+52218
-8486
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Include/internal/pycore_runtime_init_generated.h generated
7373
Include/opcode.h generated
7474
Include/token.h generated
7575
Lib/keyword.py generated
76+
Lib/test/levenshtein_examples.json generated
7677
Lib/test/test_stable_abi_ctypes.py generated
7778
Lib/token.py generated
7879
Objects/typeslots.inc generated

.github/workflows/project-updater.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
- { project: 2, label: "release-blocker, deferred-blocker" }
1919
- { project: 3, label: expert-subinterpreters }
2020
- { project: 29, label: expert-asyncio }
21+
- { project: 32, label: sprint }
2122

2223
steps:
2324
- uses: actions/[email protected]

Doc/c-api/arg.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,17 @@ which disallows mutable objects such as :class:`bytearray`.
129129
``S`` (:class:`bytes`) [PyBytesObject \*]
130130
Requires that the Python object is a :class:`bytes` object, without
131131
attempting any conversion. Raises :exc:`TypeError` if the object is not
132-
a bytes object. The C variable may also be declared as :c:type:`PyObject*`.
132+
a bytes object. The C variable may also be declared as :c:expr:`PyObject*`.
133133

134134
``Y`` (:class:`bytearray`) [PyByteArrayObject \*]
135135
Requires that the Python object is a :class:`bytearray` object, without
136136
attempting any conversion. Raises :exc:`TypeError` if the object is not
137-
a :class:`bytearray` object. The C variable may also be declared as :c:type:`PyObject*`.
137+
a :class:`bytearray` object. The C variable may also be declared as :c:expr:`PyObject*`.
138138

139139
``U`` (:class:`str`) [PyObject \*]
140140
Requires that the Python object is a Unicode object, without attempting
141141
any conversion. Raises :exc:`TypeError` if the object is not a Unicode
142-
object. The C variable may also be declared as :c:type:`PyObject*`.
142+
object. The C variable may also be declared as :c:expr:`PyObject*`.
143143

144144
``w*`` (read-write :term:`bytes-like object`) [Py_buffer]
145145
This format accepts any object which implements the read-write buffer
@@ -283,7 +283,7 @@ Other objects
283283
``O!`` (object) [*typeobject*, PyObject \*]
284284
Store a Python object in a C object pointer. This is similar to ``O``, but
285285
takes two C arguments: the first is the address of a Python type object, the
286-
second is the address of the C variable (of type :c:type:`PyObject*`) into which
286+
second is the address of the C variable (of type :c:expr:`PyObject*`) into which
287287
the object pointer is stored. If the Python object does not have the required
288288
type, :exc:`TypeError` is raised.
289289

@@ -444,7 +444,7 @@ API Functions
444444
*args*; it must actually be a tuple. The length of the tuple must be at least
445445
*min* and no more than *max*; *min* and *max* may be equal. Additional
446446
arguments must be passed to the function, each of which should be a pointer to a
447-
:c:type:`PyObject*` variable; these will be filled in with the values from
447+
:c:expr:`PyObject*` variable; these will be filled in with the values from
448448
*args*; they will contain :term:`borrowed references <borrowed reference>`.
449449
The variables which correspond
450450
to optional parameters not given by *args* will not be filled in; these should

Doc/c-api/call.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ please see individual documentation for details.
284284
285285
This is the equivalent of the Python expression: ``callable(*args)``.
286286
287-
Note that if you only pass :c:type:`PyObject *` args,
287+
Note that if you only pass :c:expr:`PyObject *` args,
288288
:c:func:`PyObject_CallFunctionObjArgs` is a faster alternative.
289289
290290
.. versionchanged:: 3.4
@@ -305,7 +305,7 @@ please see individual documentation for details.
305305
This is the equivalent of the Python expression:
306306
``obj.name(arg1, arg2, ...)``.
307307
308-
Note that if you only pass :c:type:`PyObject *` args,
308+
Note that if you only pass :c:expr:`PyObject *` args,
309309
:c:func:`PyObject_CallMethodObjArgs` is a faster alternative.
310310
311311
.. versionchanged:: 3.4
@@ -315,7 +315,7 @@ please see individual documentation for details.
315315
.. c:function:: PyObject* PyObject_CallFunctionObjArgs(PyObject *callable, ...)
316316
317317
Call a callable Python object *callable*, with a variable number of
318-
:c:type:`PyObject *` arguments. The arguments are provided as a variable number
318+
:c:expr:`PyObject *` arguments. The arguments are provided as a variable number
319319
of parameters followed by *NULL*.
320320
321321
Return the result of the call on success, or raise an exception and return
@@ -329,7 +329,7 @@ please see individual documentation for details.
329329
330330
Call a method of the Python object *obj*, where the name of the method is given as a
331331
Python string object in *name*. It is called with a variable number of
332-
:c:type:`PyObject *` arguments. The arguments are provided as a variable number
332+
:c:expr:`PyObject *` arguments. The arguments are provided as a variable number
333333
of parameters followed by *NULL*.
334334
335335
Return the result of the call on success, or raise an exception and return

Doc/c-api/dict.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Dictionary Objects
118118
.. c:function:: PyObject* PyDict_GetItemString(PyObject *p, const char *key)
119119
120120
This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a
121-
:c:expr:`const char*`, rather than a :c:type:`PyObject*`.
121+
:c:expr:`const char*`, rather than a :c:expr:`PyObject*`.
122122
123123
Note that exceptions which occur while calling :meth:`__hash__` and
124124
:meth:`__eq__` methods and creating a temporary string object
@@ -167,7 +167,7 @@ Dictionary Objects
167167
prior to the first call to this function to start the iteration; the
168168
function returns true for each pair in the dictionary, and false once all
169169
pairs have been reported. The parameters *pkey* and *pvalue* should either
170-
point to :c:type:`PyObject*` variables that will be filled in with each key
170+
point to :c:expr:`PyObject*` variables that will be filled in with each key
171171
and value, respectively, or may be ``NULL``. Any references returned through
172172
them are borrowed. *ppos* should not be altered during iteration. Its
173173
value represents offsets within the internal dictionary structure, and

Doc/c-api/exceptions.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ For convenience, some of these functions will always return a
189189
.. c:function:: PyObject* PyErr_SetFromWindowsErr(int ierr)
190190
191191
This is a convenience function to raise :exc:`WindowsError`. If called with
192-
*ierr* of :c:data:`0`, the error code returned by a call to :c:func:`GetLastError`
192+
*ierr* of ``0``, the error code returned by a call to :c:func:`GetLastError`
193193
is used instead. It calls the Win32 function :c:func:`FormatMessage` to retrieve
194194
the Windows description of error code given by *ierr* or :c:func:`GetLastError`,
195195
then it constructs a tuple object whose first item is the *ierr* value and whose
@@ -848,7 +848,7 @@ Standard Exceptions
848848
849849
All standard Python exceptions are available as global variables whose names are
850850
``PyExc_`` followed by the Python exception name. These have the type
851-
:c:type:`PyObject*`; they are all class objects. For completeness, here are all
851+
:c:expr:`PyObject*`; they are all class objects. For completeness, here are all
852852
the variables:
853853
854854
.. index::
@@ -1068,7 +1068,7 @@ Standard Warning Categories
10681068
10691069
All standard Python warning categories are available as global variables whose
10701070
names are ``PyExc_`` followed by the Python exception name. These have the type
1071-
:c:type:`PyObject*`; they are all class objects. For completeness, here are all
1071+
:c:expr:`PyObject*`; they are all class objects. For completeness, here are all
10721072
the variables:
10731073
10741074
.. index::

Doc/c-api/file.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ File Objects
88
.. index:: object: file
99

1010
These APIs are a minimal emulation of the Python 2 C API for built-in file
11-
objects, which used to rely on the buffered I/O (:c:type:`FILE*`) support
11+
objects, which used to rely on the buffered I/O (:c:expr:`FILE*`) support
1212
from the C standard library. In Python 3, files and streams use the new
1313
:mod:`io` module, which defines several layers over the low-level unbuffered
1414
I/O of the operating system. The functions described below are
@@ -65,7 +65,7 @@ the :mod:`io` APIs instead.
6565
Overrides the normal behavior of :func:`io.open_code` to pass its parameter
6666
through the provided handler.
6767
68-
The handler is a function of type :c:type:`PyObject *(\*)(PyObject *path,
68+
The handler is a function of type :c:expr:`PyObject *(\*)(PyObject *path,
6969
void *userData)`, where *path* is guaranteed to be :c:type:`PyUnicodeObject`.
7070
7171
The *userData* pointer is passed into the hook function. Since hook

Doc/c-api/import.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ Importing Modules
243243
UTF-8 encoded string instead of a Unicode object.
244244
245245
246-
.. c:type:: struct _frozen
246+
.. c:struct:: _frozen
247247
248248
.. index:: single: freeze utility
249249
@@ -265,7 +265,7 @@ Importing Modules
265265
266266
.. c:var:: const struct _frozen* PyImport_FrozenModules
267267
268-
This pointer is initialized to point to an array of :c:type:`struct _frozen`
268+
This pointer is initialized to point to an array of :c:struct:`_frozen`
269269
records, terminated by one whose members are all ``NULL`` or zero. When a frozen
270270
module is imported, it is searched in this table. Third-party code could play
271271
tricks with this to provide a dynamically created collection of frozen modules.
@@ -281,7 +281,7 @@ Importing Modules
281281
:c:func:`Py_Initialize`.
282282
283283
284-
.. c:type:: struct _inittab
284+
.. c:struct:: _inittab
285285
286286
Structure describing a single entry in the list of built-in modules. Each of
287287
these structures gives the name and initialization function for a module built

Doc/c-api/init.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ code, or when embedding the Python interpreter:
10231023
.. c:type:: PyThreadState
10241024
10251025
This data structure represents the state of a single thread. The only public
1026-
data member is :attr:`interp` (:c:type:`PyInterpreterState *`), which points to
1026+
data member is :attr:`interp` (:c:expr:`PyInterpreterState *`), which points to
10271027
this thread's interpreter state.
10281028
10291029
@@ -1875,7 +1875,7 @@ you need to include :file:`pythread.h` to use thread-local storage.
18751875
.. note::
18761876
None of these API functions handle memory management on behalf of the
18771877
:c:expr:`void*` values. You need to allocate and deallocate them yourself.
1878-
If the :c:expr:`void*` values happen to be :c:type:`PyObject*`, these
1878+
If the :c:expr:`void*` values happen to be :c:expr:`PyObject*`, these
18791879
functions don't do refcount operations on them either.
18801880
18811881
.. _thread-specific-storage-api:

Doc/c-api/init_config.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,24 @@ PyConfig
828828
829829
Default: ``0``.
830830
831+
.. c:member:: int int_max_str_digits
832+
833+
Configures the :ref:`integer string conversion length limitation
834+
<int_max_str_digits>`. An initial value of ``-1`` means the value will
835+
be taken from the command line or environment or otherwise default to
836+
4300 (:data:`sys.int_info.default_max_str_digits`). A value of ``0``
837+
disables the limitation. Values greater than zero but less than 640
838+
(:data:`sys.int_info.str_digits_check_threshold`) are unsupported and
839+
will produce an error.
840+
841+
Configured by the :option:`-X int_max_str_digits <-X>` command line
842+
flag or the :envvar:`PYTHONINTMAXSTRDIGITS` environment varable.
843+
844+
Default: ``-1`` in Python mode. 4300
845+
(:data:`sys.int_info.default_max_str_digits`) in isolated mode.
846+
847+
.. versionadded:: 3.12
848+
831849
.. c:member:: int isolated
832850
833851
If greater than ``0``, enable isolated mode:

0 commit comments

Comments
 (0)