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

Skip to content

Commit 06880bb

Browse files
Merge branch 'main' into c-classmethod-descriptor-reduce
2 parents d79301d + f8cbd79 commit 06880bb

File tree

641 files changed

+92585
-44337
lines changed

Some content is hidden

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

641 files changed

+92585
-44337
lines changed

.azure-pipelines/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
variables:
5858
testRunTitle: '$(build.sourceBranchName)-linux'
5959
testRunPlatform: linux
60-
openssl_version: 1.1.1n
60+
openssl_version: 1.1.1q
6161

6262
steps:
6363
- template: ./posix-steps.yml
@@ -83,7 +83,7 @@ jobs:
8383
variables:
8484
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
8585
testRunPlatform: linux-coverage
86-
openssl_version: 1.1.1n
86+
openssl_version: 1.1.1q
8787

8888
steps:
8989
- template: ./posix-steps.yml

.azure-pipelines/pr.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
variables:
5858
testRunTitle: '$(system.pullRequest.TargetBranch)-linux'
5959
testRunPlatform: linux
60-
openssl_version: 1.1.1n
60+
openssl_version: 1.1.1q
6161

6262
steps:
6363
- template: ./posix-steps.yml
@@ -83,7 +83,7 @@ jobs:
8383
variables:
8484
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
8585
testRunPlatform: linux-coverage
86-
openssl_version: 1.1.1n
86+
openssl_version: 1.1.1q
8787

8888
steps:
8989
- template: ./posix-steps.yml

.gitattributes

+1
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/build.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ jobs:
175175
needs: check_source
176176
if: needs.check_source.outputs.run_tests == 'true'
177177
env:
178-
OPENSSL_VER: 1.1.1n
178+
OPENSSL_VER: 1.1.1q
179179
PYTHONSTRICTEXTENSIONBUILD: 1
180180
steps:
181181
- uses: actions/checkout@v3
@@ -234,7 +234,7 @@ jobs:
234234
strategy:
235235
fail-fast: false
236236
matrix:
237-
openssl_ver: [1.1.1n, 3.0.2]
237+
openssl_ver: [1.1.1q, 3.0.5]
238238
env:
239239
OPENSSL_VER: ${{ matrix.openssl_ver }}
240240
MULTISSL_DIR: ${{ github.workspace }}/multissl
@@ -281,7 +281,7 @@ jobs:
281281
needs: check_source
282282
if: needs.check_source.outputs.run_tests == 'true'
283283
env:
284-
OPENSSL_VER: 1.1.1n
284+
OPENSSL_VER: 1.1.1q
285285
PYTHONSTRICTEXTENSIONBUILD: 1
286286
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
287287
steps:

.github/workflows/project-updater.yml

+13-4
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,21 @@ on:
88

99
jobs:
1010
add-to-project:
11-
name: Add to the Release and Deferred Blocker project
11+
name: Add issues to projects
1212
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
include:
16+
# if an issue has any of these labels, it will be added
17+
# to the corresponding project
18+
- { project: 2, label: "release-blocker, deferred-blocker" }
19+
- { project: 3, label: expert-subinterpreters }
20+
- { project: 29, label: expert-asyncio }
21+
- { project: 32, label: sprint }
22+
1323
steps:
1424
- uses: actions/[email protected]
1525
with:
16-
project-url: https://github.com/orgs/python/projects/2
26+
project-url: https://github.com/orgs/python/projects/${{ matrix.project }}
1727
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
18-
labeled: release-blocker, deferred-blocker
19-
label-operator: OR
28+
labeled: ${{ matrix.label }}

Doc/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ If you'd like to create the virtual environment in a different location,
4040
you can specify it using the ``VENVDIR`` variable.
4141

4242
You can also skip creating the virtual environment altogether, in which case
43-
the Makefile will look for instances of ``sphinxbuild`` and ``blurb``
43+
the Makefile will look for instances of ``sphinx-build`` and ``blurb``
4444
installed on your process ``PATH`` (configurable with the ``SPHINXBUILD`` and
4545
``BLURB`` variables).
4646

Doc/about.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ These documents are generated from `reStructuredText`_ sources by `Sphinx`_, a
77
document processor specifically written for the Python documentation.
88

99
.. _reStructuredText: https://docutils.sourceforge.io/rst.html
10-
.. _Sphinx: http://sphinx-doc.org/
10+
.. _Sphinx: https://www.sphinx-doc.org/
1111

1212
.. In the online version of these documents, you can submit comments and suggest
1313
changes directly on the documentation pages.

Doc/c-api/arg.rst

+5-5
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

+4-4
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/code.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.. highlight:: c
22

3-
.. _codeobjects:
4-
53
.. index:: object; code, code object
64

5+
.. _codeobjects:
6+
77
Code Objects
88
------------
99

Doc/c-api/dict.rst

+2-2
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:type:`const char*`, rather than a :c:type:`PyObject*`.
121+
:c:type:`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

+3-3
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

+2-2
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/function.rst

+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``

Doc/c-api/import.rst

+3-3
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

+2-2
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:type:`void*` values. You need to allocate and deallocate them yourself.
1878-
If the :c:type:`void*` values happen to be :c:type:`PyObject*`, these
1878+
If the :c:type:`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

+32
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:
@@ -1155,6 +1173,20 @@ PyConfig
11551173
11561174
Default: ``-1`` in Python mode, ``0`` in isolated mode.
11571175
1176+
.. c:member:: int perf_profiling
1177+
1178+
Enable compatibility mode with the perf profiler?
1179+
1180+
If non-zero, initialize the perf trampoline. See :ref:`perf_profiling`
1181+
for more information.
1182+
1183+
Set by :option:`-X perf <-X>` command line option and by the
1184+
:envvar:`PYTHONPERFSUPPORT` environment variable.
1185+
1186+
Default: ``-1``.
1187+
1188+
.. versionadded:: 3.12
1189+
11581190
.. c:member:: int use_environment
11591191
11601192
Use :ref:`environment variables <using-on-envvars>`?

Doc/c-api/intro.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,13 @@ Objects, Types and Reference Counts
264264
.. index:: object: type
265265

266266
Most Python/C API functions have one or more arguments as well as a return value
267-
of type :c:type:`PyObject*`. This type is a pointer to an opaque data type
267+
of type :c:expr:`PyObject*`. This type is a pointer to an opaque data type
268268
representing an arbitrary Python object. Since all Python object types are
269269
treated the same way by the Python language in most situations (e.g.,
270270
assignments, scope rules, and argument passing), it is only fitting that they
271271
should be represented by a single C type. Almost all Python objects live on the
272272
heap: you never declare an automatic or static variable of type
273-
:c:type:`PyObject`, only pointer variables of type :c:type:`PyObject*` can be
273+
:c:type:`PyObject`, only pointer variables of type :c:expr:`PyObject*` can be
274274
declared. The sole exception are the type objects; since these must never be
275275
deallocated, they are typically static :c:type:`PyTypeObject` objects.
276276

0 commit comments

Comments
 (0)