Skip to content

Commit ceb82b2

Browse files
Merge branch 'main' into gh-159689-processpool-mid-send
2 parents 5795a87 + 67683da commit ceb82b2

173 files changed

Lines changed: 3446 additions & 791 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.

‎Doc/c-api/init_config.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ UTF-8 encoded string. See :ref:`Configuration Options <pyinitconfig-opts>`.
167167
Get a string list configuration option as an array of
168168
null-terminated UTF-8 encoded strings.
169169
170-
* Set *\*length* and *\*value*, and return ``0`` on success.
170+
* Set *\*length* and *\*items*, and return ``0`` on success.
171171
* Set an error in *config* and return ``-1`` on error.
172172
173173
On success, the string list must be released with
@@ -1948,7 +1948,7 @@ PyConfig
19481948
If equals to zero, ignore the :ref:`environment variables
19491949
<using-on-envvars>`.
19501950
1951-
Set to ``0`` by the :option:`-E` environment variable.
1951+
Set to ``0`` by the :option:`-E` command-line option.
19521952
19531953
Default: ``1`` in Python config and ``0`` in isolated config.
19541954

‎Doc/c-api/interp-lifecycle.rst‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,9 +575,9 @@ Process-wide parameters
575575
formed from the "official" name of the operating system, converted to lower
576576
case, followed by the major revision number; e.g., for Solaris 2.x, which is
577577
also known as SunOS 5.x, the value is ``'sunos5'``. On macOS, it is
578-
``'darwin'``. On Windows, it is ``'win'``. The returned string points into
579-
static storage; the caller should not modify its value. The value is available
580-
to Python code as ``sys.platform``.
578+
``'darwin'``. On Windows, it is ``'win32'``. The returned string points
579+
into static storage; the caller should not modify its value. The value is
580+
available to Python code as ``sys.platform``.
581581
582582
583583
.. c:function:: const char* Py_GetCopyright()

‎Doc/c-api/long.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
596596
Macro for converting a Python integer into a process identifier.
597597
598598
This can be defined as an alias to :c:func:`PyLong_AsLong`,
599-
:c:func:`PyLong_FromLongLong`, or :c:func:`PyLong_AsInt`, depending on the
599+
:c:func:`PyLong_AsLongLong`, or :c:func:`PyLong_AsInt`, depending on the
600600
size of the system's PID type.
601601
602602
.. versionadded:: 3.2

‎Doc/c-api/module.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ Creation and initialization slots
337337
338338
.. versionchanged:: 3.15
339339
340-
The *slots* argument may be a ``ModuleSpec``-like object, rather than
340+
The *spec* argument may be a ``ModuleSpec``-like object, rather than
341341
a true :py:class:`~importlib.machinery.ModuleSpec` instance.
342342
Note that previous versions of CPython did not enforce this.
343343

‎Doc/c-api/slots.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ Convenience macros
197197
{NAME, PySlot_INTPTR, {0}, {(void*)(VALUE)}}
198198

199199
#define PySlot_PTR_STATIC(NAME, VALUE) \
200-
{NAME, PySlot_INTPTR|Py_SLOT_STATIC, {0}, {(void*)(VALUE)}}
200+
{NAME, PySlot_INTPTR|PySlot_STATIC, {0}, {(void*)(VALUE)}}
201201

202202
.. versionadded:: 3.15
203203

‎Doc/c-api/type.rst‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ but need extra remarks for use as slots:
676676
677677
.. c:macro:: Py_tp_bases
678678
679-
:c:member:`Slot ID <PySlot.sl_id>` for type flags, used to set
679+
:c:member:`Slot ID <PySlot.sl_id>` for base types, used to set
680680
:c:member:`PyTypeObject.tp_bases`.
681681
682682
The slot can be set to a tuple of type objects which the newly created
@@ -814,7 +814,7 @@ They will continue to work, but new features will be added as slots for
814814
:c:macro:`Py_tp_metaclass` slot.
815815
816816
A non-``NULL`` *bases* argument corresponds to the :c:data:`Py_tp_bases`
817-
slot, and takes precedence over :c:data:`Py_tp_bases` and
817+
slot, and takes precedence over :c:data:`Py_tp_base` and
818818
:c:data:`Py_tp_bases` slots.
819819
820820
A non-``NULL`` *module* argument corresponds to the
@@ -985,7 +985,7 @@ They will continue to work, but new features will be added as slots for
985985
(PySlot){
986986
.sl_id=tpslot.slot,
987987
.sl_flags=PySlot_INTPTR | sub_static,
988-
.sl_ptr=tpslot.func
988+
.sl_ptr=tpslot.pfunc
989989
}
990990
991991
where ``sub_static`` is ``PySlot_STATIC`` if the slot requires

‎Doc/extending/newtypes.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ have an associated doc string simply by providing the text in the table. An
305305
application can use the introspection API to retrieve the descriptor from the
306306
class object, and get the doc string using its :attr:`~type.__doc__` attribute.
307307

308-
As with the :c:member:`~PyTypeObject.tp_methods` table, a sentinel entry with a :c:member:`~PyMethodDef.ml_name` value
309-
of ``NULL`` is required.
308+
As with the :c:member:`~PyTypeObject.tp_methods` table, a sentinel entry with a
309+
:c:member:`~PyMemberDef.name` value of ``NULL`` is required.
310310

311311
.. XXX Descriptors need to be explained in more detail somewhere, but not here.
312312

‎Doc/howto/annotations.rst‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,22 @@ If you use a class with a custom metaclass and access ``__annotations__``
243243
on the class, you may observe unexpected behavior; see
244244
:pep:`749 <749#pep749-metaclasses>` for some examples. You can avoid these
245245
quirks by using :func:`annotationlib.get_annotations` on Python 3.14+ or
246-
:func:`inspect.get_annotations` on Python 3.10+. On earlier versions of
247-
Python, you can avoid these bugs by accessing the annotations from the
248-
class's :attr:`~type.__dict__`
249-
(for example, ``cls.__dict__.get('__annotations__', None)``).
246+
:func:`inspect.get_annotations` on Python 3.10+.
247+
248+
.. note::
249+
250+
On Python 3.14 and later, annotations are evaluated lazily (see
251+
:pep:`649` and :pep:`749`), and how the annotations dict is stored in
252+
the class's :attr:`~type.__dict__` is a private implementation detail.
253+
Reading ``cls.__dict__.get('__annotations__', None)`` may therefore
254+
return ``None`` even when the class has annotations. On these versions,
255+
always use :func:`annotationlib.get_annotations` (or
256+
:func:`inspect.get_annotations`) rather than accessing
257+
:attr:`~type.__dict__` directly.
258+
259+
Only on Python 3.9 and earlier, where neither function is available, can you
260+
avoid these bugs by reading the annotations from the class's
261+
:attr:`~type.__dict__` (for example, ``cls.__dict__.get('__annotations__', None)``).
250262

251263
In some versions of Python, instances of classes may have an ``__annotations__``
252264
attribute. However, this is not supported functionality. If you need the

‎Doc/howto/instrumentation.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ available:
457457

458458
.. object:: python.function.return(str filename, str funcname, int lineno, frameptr)
459459

460-
This probe point is the converse of ``python.function.return``, and
460+
This probe point is the converse of ``python.function.entry``, and
461461
indicates that execution of a Python function has ended (either via
462462
``return``, or via an exception). It is only triggered for pure-Python
463463
(bytecode) functions.

‎Doc/library/cmd.rst‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,15 @@ A :class:`Cmd` instance has the following methods:
110110
undocumented commands.
111111

112112

113-
.. method:: Cmd.onecmd(str)
113+
.. method:: Cmd.onecmd(line)
114114

115115
Interpret the argument as though it had been typed in response to the prompt.
116116
This may be overridden, but should not normally need to be; see the
117117
:meth:`precmd` and :meth:`postcmd` methods for useful execution hooks. The
118118
return value is a flag indicating whether interpretation of commands by the
119119
interpreter should stop. If there is a :meth:`!do_\*` method for the command
120-
*str*, the return value of that method is returned, otherwise the return value
121-
from the :meth:`default` method is returned.
120+
*line*, the return value of that method is returned, otherwise the return
121+
value from the :meth:`default` method is returned.
122122

123123

124124
.. method:: Cmd.emptyline()

0 commit comments

Comments
 (0)