Skip to content

Commit 57af5d2

Browse files
authored
Merge branch 'main' into pythongh-123826
2 parents 0ebc735 + 11fa119 commit 57af5d2

76 files changed

Lines changed: 1921 additions & 990 deletions

File tree

Some content is hidden

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

‎.github/CODEOWNERS‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,3 +276,6 @@ Lib/test/test_interpreters/ @ericsnowcurrently
276276
# Config Parser
277277
Lib/configparser.py @jaraco
278278
Lib/test/test_configparser.py @jaraco
279+
280+
# Doc sections
281+
Doc/reference/ @willingc

‎Doc/c-api/bytes.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ called with a non-bytes parameter.
204204
On success, return a new :class:`bytes` object.
205205
On error, set an exception and return ``NULL``.
206206
207-
.. versionadded: 3.14
207+
.. versionadded:: 3.14
208208
209209
210210
.. c:function:: int _PyBytes_Resize(PyObject **bytes, Py_ssize_t newsize)

‎Doc/c-api/init_config.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ PyPreConfig
324324
* Set :c:member:`PyConfig.filesystem_encoding` to ``"mbcs"``,
325325
* Set :c:member:`PyConfig.filesystem_errors` to ``"replace"``.
326326
327-
Initialized the from :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment
327+
Initialized from the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment
328328
variable value.
329329
330330
Only available on Windows. ``#ifdef MS_WINDOWS`` macro can be used for

‎Doc/c-api/structures.rst‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,8 @@ Accessing attributes of extension types
485485
``PyMemberDef`` may contain a definition for the special member
486486
``"__vectorcalloffset__"``, corresponding to
487487
:c:member:`~PyTypeObject.tp_vectorcall_offset` in type objects.
488-
These must be defined with ``Py_T_PYSSIZET`` and ``Py_READONLY``, for example::
488+
This member must be defined with ``Py_T_PYSSIZET``, and either
489+
``Py_READONLY`` or ``Py_READONLY | Py_RELATIVE_OFFSET``. For example::
489490
490491
static PyMemberDef spam_type_members[] = {
491492
{"__vectorcalloffset__", Py_T_PYSSIZET,
@@ -506,6 +507,12 @@ Accessing attributes of extension types
506507
``PyMemberDef`` is always available.
507508
Previously, it required including ``"structmember.h"``.
508509
510+
.. versionchanged:: 3.14
511+
512+
:c:macro:`Py_RELATIVE_OFFSET` is now allowed for
513+
``"__vectorcalloffset__"``, ``"__dictoffset__"`` and
514+
``"__weaklistoffset__"``.
515+
509516
.. c:function:: PyObject* PyMember_GetOne(const char *obj_addr, struct PyMemberDef *m)
510517
511518
Get an attribute belonging to the object at address *obj_addr*. The

‎Doc/howto/free-threading-extensions.rst‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,3 +270,9 @@ Windows
270270

271271
Due to a limitation of the official Windows installer, you will need to
272272
manually define ``Py_GIL_DISABLED=1`` when building extensions from source.
273+
274+
.. seealso::
275+
276+
`Porting Extension Modules to Support Free-Threading
277+
<https://py-free-threading.github.io/porting/>`_:
278+
A community-maintained porting guide for extension authors.

‎Doc/library/collections.abc.rst‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ Collections Abstract Base Classes -- Detailed Descriptions
213213

214214
ABC for classes that provide the :meth:`~object.__call__` method.
215215

216+
See :ref:`annotating-callables` for details on how to use
217+
:class:`!Callable` in type annotations.
218+
216219
.. class:: Iterable
217220

218221
ABC for classes that provide the :meth:`~container.__iter__` method.
@@ -250,6 +253,9 @@ Collections Abstract Base Classes -- Detailed Descriptions
250253
:meth:`~generator.send`,
251254
:meth:`~generator.throw` and :meth:`~generator.close` methods.
252255

256+
See :ref:`annotating-generators-and-coroutines`
257+
for details on using :class:`!Generator` in type annotations.
258+
253259
.. versionadded:: 3.5
254260

255261
.. class:: Sequence
@@ -321,6 +327,11 @@ Collections Abstract Base Classes -- Detailed Descriptions
321327
Using ``isinstance(gencoro, Coroutine)`` for them will return ``False``.
322328
Use :func:`inspect.isawaitable` to detect them.
323329

330+
See :ref:`annotating-generators-and-coroutines`
331+
for details on using :class:`!Coroutine` in type annotations.
332+
The variance and order of type parameters correspond to those of
333+
:class:`Generator`.
334+
324335
.. versionadded:: 3.5
325336

326337
.. class:: AsyncIterable
@@ -342,6 +353,9 @@ Collections Abstract Base Classes -- Detailed Descriptions
342353
ABC for :term:`asynchronous generator` classes that implement the protocol
343354
defined in :pep:`525` and :pep:`492`.
344355

356+
See :ref:`annotating-generators-and-coroutines`
357+
for details on using :class:`!AsyncGenerator` in type annotations.
358+
345359
.. versionadded:: 3.6
346360

347361
.. class:: Buffer

‎Doc/library/constants.rst‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ A small number of constants live in the built-in namespace. They are:
8282
:exc:`SyntaxError`), so they can be considered "true" constants.
8383

8484

85+
.. _site-consts:
86+
8587
Constants added by the :mod:`site` module
8688
-----------------------------------------
8789

@@ -97,6 +99,13 @@ should not be used in programs.
9799
(i.e. EOF) to exit", and when called, raise :exc:`SystemExit` with the
98100
specified exit code.
99101

102+
.. data:: help
103+
:noindex:
104+
105+
Object that when printed, prints the message "Type help() for interactive
106+
help, or help(object) for help about object.", and when called,
107+
acts as described :func:`elsewhere <help>`.
108+
100109
.. data:: copyright
101110
credits
102111

‎Doc/library/datetime.rst‎

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -283,17 +283,23 @@ Class attributes:
283283
Note that, because of normalization, ``timedelta.max`` is greater than ``-timedelta.min``.
284284
``-timedelta.max`` is not representable as a :class:`timedelta` object.
285285

286+
286287
Instance attributes (read-only):
287288

288-
+------------------+--------------------------------------------+
289-
| Attribute | Value |
290-
+==================+============================================+
291-
| ``days`` | Between -999999999 and 999999999 inclusive |
292-
+------------------+--------------------------------------------+
293-
| ``seconds`` | Between 0 and 86399 inclusive |
294-
+------------------+--------------------------------------------+
295-
| ``microseconds`` | Between 0 and 999999 inclusive |
296-
+------------------+--------------------------------------------+
289+
.. attribute:: timedelta.days
290+
291+
Between -999,999,999 and 999,999,999 inclusive.
292+
293+
294+
.. attribute:: timedelta.seconds
295+
296+
Between 0 and 86,399 inclusive.
297+
298+
299+
.. attribute:: timedelta.microseconds
300+
301+
Between 0 and 999,999 inclusive.
302+
297303

298304
Supported operations:
299305

‎Doc/library/functions.rst‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1965,10 +1965,10 @@ are always available. They are listed here in alphabetical order.
19651965
``D -> B -> C -> A -> object`` and the value of *type* is ``B``,
19661966
then :func:`super` searches ``C -> A -> object``.
19671967

1968-
The :attr:`~class.__mro__` attribute of the *object_or_type* lists the method
1969-
resolution search order used by both :func:`getattr` and :func:`super`. The
1970-
attribute is dynamic and can change whenever the inheritance hierarchy is
1971-
updated.
1968+
The :attr:`~class.__mro__` attribute of the class corresponding to
1969+
*object_or_type* lists the method resolution search order used by both
1970+
:func:`getattr` and :func:`super`. The attribute is dynamic and can change
1971+
whenever the inheritance hierarchy is updated.
19721972

19731973
If the second argument is omitted, the super object returned is unbound. If
19741974
the second argument is an object, ``isinstance(obj, type)`` must be true. If

‎Doc/library/logging.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,11 +1098,11 @@ information into logging calls. For a usage example, see the section on
10981098

10991099
.. attribute:: manager
11001100

1101-
Delegates to the underlying :attr:`!manager`` on *logger*.
1101+
Delegates to the underlying :attr:`!manager` on *logger*.
11021102

11031103
.. attribute:: _log
11041104

1105-
Delegates to the underlying :meth:`!_log`` method on *logger*.
1105+
Delegates to the underlying :meth:`!_log` method on *logger*.
11061106

11071107
In addition to the above, :class:`LoggerAdapter` supports the following
11081108
methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`,

0 commit comments

Comments
 (0)