Skip to content

Commit ecfa62b

Browse files
committed
Merge branch 'main' into quickening-infrastructure
2 parents b7c3995 + 6ab65c6 commit ecfa62b

File tree

114 files changed

+8269
-7338
lines changed

Some content is hidden

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

114 files changed

+8269
-7338
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ Python/ast_opt.c @isidentical
5353

5454

5555
# SSL
56-
**/*ssl* @python/crypto-team @tiran
57-
**/*.pem @python/crypto-team @tiran
56+
**/*ssl* @python/crypto-team
57+
**/*.pem @python/crypto-team
5858

5959
# CSPRNG
60-
Python/bootstrap_hash.c @python/crypto-team @tiran
60+
Python/bootstrap_hash.c @python/crypto-team
6161

6262
# Dates and times
6363
**/*datetime* @pganssle @abalkin

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ jobs:
150150
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
151151
- name: 'Restore OpenSSL build'
152152
id: cache-openssl
153-
uses: actions/[email protected].5
153+
uses: actions/[email protected].6
154154
with:
155155
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
156156
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
@@ -198,7 +198,7 @@ jobs:
198198
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
199199
- name: 'Restore OpenSSL build'
200200
id: cache-openssl
201-
uses: actions/[email protected].5
201+
uses: actions/[email protected].6
202202
with:
203203
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
204204
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}

Doc/c-api/gcsupport.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ Constructors for container types must conform to two rules:
3333
#. Once all the fields which may contain references to other containers are
3434
initialized, it must call :c:func:`PyObject_GC_Track`.
3535

36+
.. warning::
37+
If a type adds the Py_TPFLAGS_HAVE_GC, then it *must* implement at least
38+
a :c:member:`~PyTypeObject.tp_traverse` handler or explicitly use one
39+
from its subclass or subclasses.
40+
41+
When calling :c:func:`PyType_Ready` or some of the APIs that indirectly
42+
call it like :c:func:`PyType_FromSpecWithBases` or
43+
:c:func:`PyType_FromSpec` the interpreter will automatically populate the
44+
:c:member:`~PyTypeObject.tp_flags`, :c:member:`~PyTypeObject.tp_traverse`
45+
and :c:member:`~PyTypeObject.tp_clear` fields if the type inherits from a
46+
class that implements the garbage collector protocol and the child class
47+
does *not* include the :const:`Py_TPFLAGS_HAVE_GC` flag.
3648

3749
.. c:function:: TYPE* PyObject_GC_New(TYPE, PyTypeObject *type)
3850

Doc/c-api/structures.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ the definition of all other Python objects.
9999
100100
Return a :term:`borrowed reference`.
101101
102-
The :c:func:`Py_SET_TYPE` function must be used to set an object type.
102+
Use the :c:func:`Py_SET_TYPE` function to set an object type.
103+
104+
.. versionchanged:: 3.11
105+
:c:func:`Py_TYPE()` is changed to an inline static function.
103106
104107
105108
.. c:function:: int Py_IS_TYPE(PyObject *o, PyTypeObject *type)
@@ -121,9 +124,10 @@ the definition of all other Python objects.
121124
122125
Get the reference count of the Python object *o*.
123126
127+
Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count.
128+
124129
.. versionchanged:: 3.10
125130
:c:func:`Py_REFCNT()` is changed to the inline static function.
126-
Use :c:func:`Py_SET_REFCNT()` to set an object reference count.
127131
128132
129133
.. c:function:: void Py_SET_REFCNT(PyObject *o, Py_ssize_t refcnt)
@@ -137,7 +141,10 @@ the definition of all other Python objects.
137141
138142
Get the size of the Python object *o*.
139143
140-
The :c:func:`Py_SET_SIZE` function must be used to set an object size.
144+
Use the :c:func:`Py_SET_SIZE` function to set an object size.
145+
146+
.. versionchanged:: 3.11
147+
:c:func:`Py_SIZE()` is changed to an inline static function.
141148
142149
143150
.. c:function:: void Py_SET_SIZE(PyVarObject *o, Py_ssize_t size)

Doc/c-api/type.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ Type Objects
9797
from a type's base class. Return ``0`` on success, or return ``-1`` and sets an
9898
exception on error.
9999
100+
.. note::
101+
If some of the base classes implements the GC protocol and the provided
102+
type does not include the :const:`Py_TPFLAGS_HAVE_GC` in its flags, then
103+
the GC protocol will be automatically implemented from its parents. On
104+
the contrary, if the type being created does include
105+
:const:`Py_TPFLAGS_HAVE_GC` in its flags then it **must** implement the
106+
GC protocol itself by at least implementing the
107+
:c:member:`~PyTypeObject.tp_traverse` handle.
108+
100109
.. c:function:: void* PyType_GetSlot(PyTypeObject *type, int slot)
101110
102111
Return the function pointer stored in the given slot. If the

Doc/c-api/typeobj.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2453,6 +2453,8 @@ Async Object Structures
24532453
See :c:func:`PyIter_Send` for details.
24542454
This slot may be set to ``NULL``.
24552455

2456+
.. versionadded:: 3.10
2457+
24562458

24572459
.. _slot-typedefs:
24582460

Doc/c-api/unicode.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,12 @@ APIs:
421421
:c:func:`PyUnicode_KIND`). The *buffer* must point to an array of *size*
422422
units of 1, 2 or 4 bytes per character, as given by the kind.
423423
424+
If necessary, the input *buffer* is copied and transformed into the
425+
canonical representation. For example, if the *buffer* is a UCS4 string
426+
(:c:macro:`PyUnicode_4BYTE_KIND`) and it consists only of codepoints in
427+
the UCS1 range, it will be transformed into UCS1
428+
(:c:macro:`PyUnicode_1BYTE_KIND`).
429+
424430
.. versionadded:: 3.3
425431
426432

Doc/library/asyncio-eventloop.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,7 @@ Do not instantiate the class directly.
14401440
Start accepting connections.
14411441

14421442
This method is idempotent, so it can be called when
1443-
the server is already being serving.
1443+
the server is already serving.
14441444

14451445
The *start_serving* keyword-only parameter to
14461446
:meth:`loop.create_server` and

Doc/library/builtins.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ that wants to implement an :func:`open` function that wraps the built-in
2525
return UpperCaser(f)
2626

2727
class UpperCaser:
28-
'''Wrapper around a file that converts output to upper-case.'''
28+
'''Wrapper around a file that converts output to uppercase.'''
2929

3030
def __init__(self, f):
3131
self._f = f

Doc/library/contextlib.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,9 @@ Functions and classes provided:
267267
.. function:: suppress(*exceptions)
268268

269269
Return a context manager that suppresses any of the specified exceptions
270-
if they occur in the body of a with statement and then resumes execution
271-
with the first statement following the end of the with statement.
270+
if they are raised in the body of a :keyword:`!with` statement and then
271+
resumes execution with the first statement following the end of the
272+
:keyword:`!with` statement.
272273

273274
As with any other mechanism that completely suppresses exceptions, this
274275
context manager should be used only to cover very specific errors where

Doc/library/dis.rst

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,17 +1058,24 @@ All of the following opcodes use their arguments.
10581058

10591059
.. opcode:: LOAD_CLOSURE (i)
10601060

1061-
Pushes a reference to the cell contained in slot *i* of the cell and free
1062-
variable storage. The name of the variable is ``co_cellvars[i]`` if *i* is
1063-
less than the length of *co_cellvars*. Otherwise it is ``co_freevars[i -
1064-
len(co_cellvars)]``.
1061+
Pushes a reference to the cell contained in slot ``i`` of the "fast locals"
1062+
storage. The name of the variable is ``co_fastlocalnames[i]``.
1063+
1064+
Note that ``LOAD_CLOSURE`` is effectively an alias for ``LOAD_FAST``.
1065+
It exists to keep bytecode a little more readable.
1066+
1067+
.. versionchanged:: 3.11
1068+
``i`` is no longer offset by the length of ``co_varnames``.
10651069

10661070

10671071
.. opcode:: LOAD_DEREF (i)
10681072

1069-
Loads the cell contained in slot *i* of the cell and free variable storage.
1073+
Loads the cell contained in slot ``i`` of the "fast locals" storage.
10701074
Pushes a reference to the object the cell contains on the stack.
10711075

1076+
.. versionchanged:: 3.11
1077+
``i`` is no longer offset by the length of ``co_varnames``.
1078+
10721079

10731080
.. opcode:: LOAD_CLASSDEREF (i)
10741081

@@ -1078,20 +1085,29 @@ All of the following opcodes use their arguments.
10781085

10791086
.. versionadded:: 3.4
10801087

1088+
.. versionchanged:: 3.11
1089+
``i`` is no longer offset by the length of ``co_varnames``.
1090+
10811091

10821092
.. opcode:: STORE_DEREF (i)
10831093

1084-
Stores TOS into the cell contained in slot *i* of the cell and free variable
1094+
Stores TOS into the cell contained in slot ``i`` of the "fast locals"
10851095
storage.
10861096

1097+
.. versionchanged:: 3.11
1098+
``i`` is no longer offset by the length of ``co_varnames``.
1099+
10871100

10881101
.. opcode:: DELETE_DEREF (i)
10891102

1090-
Empties the cell contained in slot *i* of the cell and free variable storage.
1103+
Empties the cell contained in slot ``i`` of the "fast locals" storage.
10911104
Used by the :keyword:`del` statement.
10921105

10931106
.. versionadded:: 3.2
10941107

1108+
.. versionchanged:: 3.11
1109+
``i`` is no longer offset by the length of ``co_varnames``.
1110+
10951111

10961112
.. opcode:: RAISE_VARARGS (argc)
10971113

Doc/library/gettext.rst

Lines changed: 7 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,6 @@ class-based API instead.
4646
returned. [#]_
4747

4848

49-
.. function:: bind_textdomain_codeset(domain, codeset=None)
50-
51-
Bind the *domain* to *codeset*, changing the encoding of byte strings
52-
returned by the :func:`lgettext`, :func:`ldgettext`, :func:`lngettext`
53-
and :func:`ldngettext` functions.
54-
If *codeset* is omitted, then the current binding is returned.
55-
56-
.. deprecated-removed:: 3.8 3.10
57-
58-
5949
.. function:: textdomain(domain=None)
6050

6151
Change or query the current global domain. If *domain* is ``None``, then the
@@ -108,29 +98,6 @@ class-based API instead.
10898
.. versionadded:: 3.8
10999

110100

111-
.. function:: lgettext(message)
112-
.. function:: ldgettext(domain, message)
113-
.. function:: lngettext(singular, plural, n)
114-
.. function:: ldngettext(domain, singular, plural, n)
115-
116-
Equivalent to the corresponding functions without the ``l`` prefix
117-
(:func:`.gettext`, :func:`dgettext`, :func:`ngettext` and :func:`dngettext`),
118-
but the translation is returned as a byte string encoded in the preferred
119-
system encoding if no other encoding was explicitly set with
120-
:func:`bind_textdomain_codeset`.
121-
122-
.. warning::
123-
124-
These functions should be avoided in Python 3, because they return
125-
encoded bytes. It's much better to use alternatives which return
126-
Unicode strings instead, since most Python applications will want to
127-
manipulate human readable text as strings instead of bytes. Further,
128-
it's possible that you may get unexpected Unicode-related exceptions
129-
if there are encoding problems with the translated strings.
130-
131-
.. deprecated-removed:: 3.8 3.10
132-
133-
134101
Note that GNU :program:`gettext` also defines a :func:`dcgettext` method, but
135102
this was deemed not useful and so it is currently unimplemented.
136103

@@ -181,7 +148,7 @@ install themselves in the built-in namespace as the function :func:`_`.
181148
the environment variables.
182149

183150

184-
.. function:: translation(domain, localedir=None, languages=None, class_=None, fallback=False, codeset=None)
151+
.. function:: translation(domain, localedir=None, languages=None, class_=None, fallback=False)
185152

186153
Return a :class:`*Translations` instance based on the *domain*, *localedir*,
187154
and *languages*, which are first passed to :func:`find` to get a list of the
@@ -205,15 +172,13 @@ install themselves in the built-in namespace as the function :func:`_`.
205172
.. versionchanged:: 3.3
206173
:exc:`IOError` used to be raised instead of :exc:`OSError`.
207174

208-
.. deprecated-removed:: 3.8 3.10
209-
The *codeset* parameter.
210-
175+
.. versionchanged:: 3.11
176+
*codeset* parameter is removed.
211177

212-
.. function:: install(domain, localedir=None, codeset=None, names=None)
178+
.. function:: install(domain, localedir=None, *, names=None)
213179

214180
This installs the function :func:`_` in Python's builtins namespace, based on
215-
*domain*, *localedir*, and *codeset* which are passed to the function
216-
:func:`translation`.
181+
*domain* and *localedir* which are passed to the function :func:`translation`.
217182

218183
For the *names* parameter, please see the description of the translation
219184
object's :meth:`~NullTranslations.install` method.
@@ -228,9 +193,8 @@ install themselves in the built-in namespace as the function :func:`_`.
228193
builtins namespace, so it is easily accessible in all modules of your
229194
application.
230195

231-
.. deprecated-removed:: 3.8 3.10
232-
The *codeset* parameter.
233-
196+
.. versionchanged:: 3.11
197+
*names* is now a keyword-only parameter.
234198

235199
The :class:`NullTranslations` class
236200
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -294,22 +258,6 @@ are the methods of :class:`!NullTranslations`:
294258
.. versionadded:: 3.8
295259

296260

297-
.. method:: lgettext(message)
298-
.. method:: lngettext(singular, plural, n)
299-
300-
Equivalent to :meth:`.gettext` and :meth:`.ngettext`, but the translation
301-
is returned as a byte string encoded in the preferred system encoding
302-
if no encoding was explicitly set with :meth:`set_output_charset`.
303-
Overridden in derived classes.
304-
305-
.. warning::
306-
307-
These methods should be avoided in Python 3. See the warning for the
308-
:func:`lgettext` function.
309-
310-
.. deprecated-removed:: 3.8 3.10
311-
312-
313261
.. method:: info()
314262

315263
Return the "protected" :attr:`_info` variable, a dictionary containing
@@ -321,21 +269,6 @@ are the methods of :class:`!NullTranslations`:
321269
Return the encoding of the message catalog file.
322270

323271

324-
.. method:: output_charset()
325-
326-
Return the encoding used to return translated messages in :meth:`.lgettext`
327-
and :meth:`.lngettext`.
328-
329-
.. deprecated-removed:: 3.8 3.10
330-
331-
332-
.. method:: set_output_charset(charset)
333-
334-
Change the encoding used to return translated messages.
335-
336-
.. deprecated-removed:: 3.8 3.10
337-
338-
339272
.. method:: install(names=None)
340273

341274
This method installs :meth:`.gettext` into the built-in namespace,
@@ -450,22 +383,6 @@ unexpected, or if other problems occur while reading the file, instantiating a
450383
.. versionadded:: 3.8
451384

452385

453-
.. method:: lgettext(message)
454-
.. method:: lngettext(singular, plural, n)
455-
456-
Equivalent to :meth:`.gettext` and :meth:`.ngettext`, but the translation
457-
is returned as a byte string encoded in the preferred system encoding
458-
if no encoding was explicitly set with
459-
:meth:`~NullTranslations.set_output_charset`.
460-
461-
.. warning::
462-
463-
These methods should be avoided in Python 3. See the warning for the
464-
:func:`lgettext` function.
465-
466-
.. deprecated-removed:: 3.8 3.10
467-
468-
469386
Solaris message catalog support
470387
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
471388

Doc/library/logging.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,14 @@ functions.
11111111
.. note:: If you are thinking of defining your own levels, please see the
11121112
section on :ref:`custom-levels`.
11131113

1114+
.. function:: getLevelNamesMapping()
1115+
1116+
Returns a mapping from level names to their corresponding logging levels. For example, the
1117+
string "CRITICAL" maps to :const:`CRITICAL`. The returned mapping is copied from an internal
1118+
mapping on each call to this function.
1119+
1120+
.. versionadded:: 3.11
1121+
11141122
.. function:: getLevelName(level)
11151123

11161124
Returns the textual or numeric representation of logging level *level*.

Doc/library/msilib.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ structures.
119119
.. function:: gen_uuid()
120120

121121
Return a new UUID, in the format that MSI typically requires (i.e. in curly
122-
braces, and with all hexdigits in upper-case).
122+
braces, and with all hexdigits in uppercase).
123123

124124

125125
.. seealso::

0 commit comments

Comments
 (0)