Skip to content

Commit 08d963d

Browse files
committed
Merge in the main branch to solve conflict
2 parents 781e2ab + 7f1e66a commit 08d963d

File tree

69 files changed

+3879
-308
lines changed

Some content is hidden

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

69 files changed

+3879
-308
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Modules/Setup* @erlend-aasland
2727
**/*genobject* @markshannon
2828
**/*hamt* @1st1
2929
**/*jit* @brandtbucher @savannahostrowski @diegorusso
30+
Python/perf_jit_trampoline.c # Exclude the owners of "**/*jit*", above.
3031
Objects/set* @rhettinger
3132
Objects/dict* @methane @markshannon
3233
Objects/typevarobject.c @JelleZijlstra

Doc/library/codecs.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ wider range of codecs when working with binary files:
243243
.. function:: iterencode(iterator, encoding, errors='strict', **kwargs)
244244

245245
Uses an incremental encoder to iteratively encode the input provided by
246-
*iterator*. This function is a :term:`generator`.
247-
The *errors* argument (as well as any
246+
*iterator*. *iterator* must yield :class:`str` objects.
247+
This function is a :term:`generator`. The *errors* argument (as well as any
248248
other keyword argument) is passed through to the incremental encoder.
249249

250250
This function requires that the codec accept text :class:`str` objects
@@ -255,8 +255,8 @@ wider range of codecs when working with binary files:
255255
.. function:: iterdecode(iterator, encoding, errors='strict', **kwargs)
256256

257257
Uses an incremental decoder to iteratively decode the input provided by
258-
*iterator*. This function is a :term:`generator`.
259-
The *errors* argument (as well as any
258+
*iterator*. *iterator* must yield :class:`bytes` objects.
259+
This function is a :term:`generator`. The *errors* argument (as well as any
260260
other keyword argument) is passed through to the incremental decoder.
261261

262262
This function requires that the codec accept :class:`bytes` objects
@@ -1395,7 +1395,11 @@ encodings.
13951395
| | | It is used in the Python |
13961396
| | | pickle protocol. |
13971397
+--------------------+---------+---------------------------+
1398-
| undefined | | Raise an exception for |
1398+
| undefined | | This Codec should only |
1399+
| | | be used for testing |
1400+
| | | purposes. |
1401+
| | | |
1402+
| | | Raise an exception for |
13991403
| | | all conversions, even |
14001404
| | | empty strings. The error |
14011405
| | | handler is ignored. |

Doc/library/email.parser.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ methods.
4848
FeedParser API
4949
^^^^^^^^^^^^^^
5050

51-
The :class:`BytesFeedParser`, imported from the :mod:`email.feedparser` module,
52-
provides an API that is conducive to incremental parsing of email messages,
51+
The :class:`BytesFeedParser`, imported from the :mod:`email.parser.FeedParser`
52+
module, provides an API that is conducive to incremental parsing of email messages,
5353
such as would be necessary when reading the text of an email message from a
5454
source that can block (such as a socket). The :class:`BytesFeedParser` can of
5555
course be used to parse an email message fully contained in a :term:`bytes-like
@@ -116,7 +116,7 @@ Here is the API for the :class:`BytesFeedParser`:
116116
Works like :class:`BytesFeedParser` except that the input to the
117117
:meth:`~BytesFeedParser.feed` method must be a string. This is of limited
118118
utility, since the only way for such a message to be valid is for it to
119-
contain only ASCII text or, if :attr:`~email.policy.Policy.utf8` is
119+
contain only ASCII text or, if :attr:`~email.policy.EmailPolicy.utf8` is
120120
``True``, no binary attachments.
121121

122122
.. versionchanged:: 3.3 Added the *policy* keyword.
@@ -155,11 +155,11 @@ message body, instead setting the payload to the raw body.
155155

156156
Read all the data from the binary file-like object *fp*, parse the
157157
resulting bytes, and return the message object. *fp* must support
158-
both the :meth:`~io.IOBase.readline` and the :meth:`~io.IOBase.read`
158+
both the :meth:`~io.IOBase.readline` and the :meth:`~io.TextIOBase.read`
159159
methods.
160160

161161
The bytes contained in *fp* must be formatted as a block of :rfc:`5322`
162-
(or, if :attr:`~email.policy.Policy.utf8` is ``True``, :rfc:`6532`)
162+
(or, if :attr:`~email.policy.EmailPolicy.utf8` is ``True``, :rfc:`6532`)
163163
style headers and header continuation lines, optionally preceded by an
164164
envelope header. The header block is terminated either by the end of the
165165
data or by a blank line. Following the header block is the body of the

Doc/library/functools.rst

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,18 @@ The :mod:`functools` module defines the following functions:
199199
and *typed*. This is for information purposes only. Mutating the values
200200
has no effect.
201201

202+
.. method:: lru_cache.cache_info()
203+
:no-typesetting:
204+
202205
To help measure the effectiveness of the cache and tune the *maxsize*
203-
parameter, the wrapped function is instrumented with a :func:`cache_info`
206+
parameter, the wrapped function is instrumented with a :func:`!cache_info`
204207
function that returns a :term:`named tuple` showing *hits*, *misses*,
205208
*maxsize* and *currsize*.
206209

207-
The decorator also provides a :func:`cache_clear` function for clearing or
210+
.. method:: lru_cache.cache_clear()
211+
:no-typesetting:
212+
213+
The decorator also provides a :func:`!cache_clear` function for clearing or
208214
invalidating the cache.
209215

210216
The original underlying function is accessible through the
@@ -284,9 +290,9 @@ The :mod:`functools` module defines the following functions:
284290
class decorator supplies the rest. This simplifies the effort involved
285291
in specifying all of the possible rich comparison operations:
286292

287-
The class must define one of :meth:`__lt__`, :meth:`__le__`,
288-
:meth:`__gt__`, or :meth:`__ge__`.
289-
In addition, the class should supply an :meth:`__eq__` method.
293+
The class must define one of :meth:`~object.__lt__`, :meth:`~object.__le__`,
294+
:meth:`~object.__gt__`, or :meth:`~object.__ge__`.
295+
In addition, the class should supply an :meth:`~object.__eq__` method.
290296

291297
For example::
292298

@@ -418,7 +424,7 @@ The :mod:`functools` module defines the following functions:
418424
like normal functions, are handled as descriptors).
419425

420426
When *func* is a descriptor (such as a normal Python function,
421-
:func:`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or
427+
:func:`classmethod`, :func:`staticmethod`, :func:`~abc.abstractmethod` or
422428
another instance of :class:`partialmethod`), calls to ``__get__`` are
423429
delegated to the underlying descriptor, and an appropriate
424430
:ref:`partial object<partial-objects>` returned as the result.
@@ -499,7 +505,10 @@ The :mod:`functools` module defines the following functions:
499505
... print("Let me just say,", end=" ")
500506
... print(arg)
501507

502-
To add overloaded implementations to the function, use the :func:`register`
508+
.. method:: singledispatch.register()
509+
:no-typesetting:
510+
511+
To add overloaded implementations to the function, use the :func:`!register`
503512
attribute of the generic function, which can be used as a decorator. For
504513
functions annotated with types, the decorator will infer the type of the
505514
first argument automatically::
@@ -565,14 +574,14 @@ The :mod:`functools` module defines the following functions:
565574
runtime impact.
566575

567576
To enable registering :term:`lambdas<lambda>` and pre-existing functions,
568-
the :func:`register` attribute can also be used in a functional form::
577+
the :func:`~singledispatch.register` attribute can also be used in a functional form::
569578

570579
>>> def nothing(arg, verbose=False):
571580
... print("Nothing.")
572581
...
573582
>>> fun.register(type(None), nothing)
574583

575-
The :func:`register` attribute returns the undecorated function. This
584+
The :func:`~singledispatch.register` attribute returns the undecorated function. This
576585
enables decorator stacking, :mod:`pickling<pickle>`, and the creation
577586
of unit tests for each variant independently::
578587

@@ -650,10 +659,10 @@ The :mod:`functools` module defines the following functions:
650659
.. versionadded:: 3.4
651660

652661
.. versionchanged:: 3.7
653-
The :func:`register` attribute now supports using type annotations.
662+
The :func:`~singledispatch.register` attribute now supports using type annotations.
654663

655664
.. versionchanged:: 3.11
656-
The :func:`register` attribute now supports
665+
The :func:`~singledispatch.register` attribute now supports
657666
:class:`typing.Union` as a type annotation.
658667

659668

@@ -783,7 +792,7 @@ The :mod:`functools` module defines the following functions:
783792
'Docstring'
784793

785794
Without the use of this decorator factory, the name of the example function
786-
would have been ``'wrapper'``, and the docstring of the original :func:`example`
795+
would have been ``'wrapper'``, and the docstring of the original :func:`!example`
787796
would have been lost.
788797

789798

0 commit comments

Comments
 (0)