Skip to content

Commit 05152ff

Browse files
[3.15] Docs: correct API descriptions and identifiers (GH-161159) (#161395)
Docs: correct API descriptions and identifiers (GH-161159) (cherry picked from commit 5aa2f70) Co-authored-by: Inada Naoki <songofacandy@gmail.com>
1 parent 3619efa commit 05152ff

15 files changed

Lines changed: 29 additions & 32 deletions

‎Doc/c-api/frame.rst‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ See also :ref:`Reflection <reflection>`.
9999
100100
Get the *frame*'s :attr:`~frame.f_lasti` attribute.
101101
102-
Returns -1 if ``frame.f_lasti`` is ``None``.
103-
104102
.. versionadded:: 3.11
105103
106104

‎Doc/c-api/gcsupport.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ rules:
4242
.. warning::
4343
If a type adds the Py_TPFLAGS_HAVE_GC, then it *must* implement at least
4444
a :c:member:`~PyTypeObject.tp_traverse` handler or explicitly use one
45-
from its subclass or subclasses.
45+
from a base class.
4646

4747
When calling :c:func:`PyType_Ready` or some of the APIs that indirectly
4848
call it like :c:func:`PyType_FromSpecWithBases` or

‎Doc/c-api/gen.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Generator Objects
66
-----------------
77

88
Generator objects are what Python uses to implement generator iterators. They
9-
are normally created by iterating over a function that yields values, rather
10-
than explicitly calling :c:func:`PyGen_New` or :c:func:`PyGen_NewWithQualName`.
9+
are normally created by calling a generator function, rather than explicitly
10+
calling :c:func:`PyGen_New` or :c:func:`PyGen_NewWithQualName`.
1111

1212

1313
.. c:type:: PyGenObject

‎Doc/c-api/object.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ Object Protocol
423423
If *cls* has a :meth:`~type.__subclasscheck__` method, it will be called to
424424
determine the subclass status as described in :pep:`3119`. Otherwise,
425425
*derived* is a subclass of *cls* if it is a direct or indirect subclass,
426-
i.e. contained in :attr:`cls.__mro__ <type.__mro__>`.
426+
i.e. if *cls* is contained in :attr:`derived.__mro__ <type.__mro__>`.
427427
428428
Normally only class objects, i.e. instances of :class:`type` or a derived
429429
class, are considered classes. However, objects can override this by having

‎Doc/c-api/typeobj.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2527,7 +2527,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
25272527

25282528
Specifically, if *type* uses the default metaclass,
25292529
``type->tp_vectorcall`` must behave the same as
2530-
:c:expr:`PyType_Type->tp_call`, which:
2530+
``Py_TYPE(type)->tp_call``, which:
25312531

25322532
- calls ``type->tp_new``,
25332533

‎Doc/howto/descriptor.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1754,7 +1754,7 @@ At this point, the metaclass has loaded member objects for *x* and *y*::
17541754
>>> isinstance(vars(H)['y'], Member)
17551755
True
17561756

1757-
When instances are created, they have a ``slot_values`` list where the
1757+
When instances are created, they have a ``_slotvalues`` list where the
17581758
attributes are stored:
17591759

17601760
.. doctest::

‎Doc/howto/enum.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ Some rules:
913913
:class:`~dataclasses.dataclass`
914914
6. %-style formatting: ``%s`` and ``%r`` call the :class:`Enum` class's
915915
:meth:`~object.__str__` and :meth:`~object.__repr__` respectively; other codes (such as
916-
``%i`` or ``%h`` for IntEnum) treat the enum member as its mixed-in type.
916+
``%i`` or ``%x`` for IntEnum) treat the enum member as its mixed-in type.
917917
7. :ref:`Formatted string literals <f-strings>`, :meth:`str.format`,
918918
and :func:`format` will use the enum's :meth:`~object.__str__` method.
919919

‎Doc/howto/isolating-extensions.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ and the corresponding :c:type:`PyCMethod` signature::
530530
PyTypeObject *defining_class, // defining class
531531
PyObject *const *args, // C array of arguments
532532
Py_ssize_t nargs, // length of "args"
533-
PyObject *kwnames) // NULL, or dict of keyword arguments
533+
PyObject *kwnames) // NULL, or tuple of keyword argument names
534534

535535
Once you have the defining class, call :c:func:`PyType_GetModuleState` to get
536536
the state of its associated module.

‎Doc/howto/perf_profiling.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ or using the environment variable::
273273

274274
``perf inject --jit`` command will read ``perf.data``,
275275
automatically pick up the perf dump file that Python creates (in
276-
``/tmp/perf-$PID.dump``), and then create ``perf.jit.data`` which merges all the
276+
``/tmp/jit-$PID.dump``), and then create ``perf.jit.data`` which merges all the
277277
JIT information together. It should also create a lot of ``jitted-XXXX-N.so``
278278
files in the current directory which are ELF images for all the JIT trampolines
279279
that were created by Python.

‎Doc/howto/remote_debugging.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ necessary entitlement and add it to the Python binary:
9898
codesign --sign - --entitlements get-task-allow.plist path/to/bin/python3
9999
100100
where ``path/to/bin/python3`` is the path to your Python binary, which you can
101-
find by e.g. running ``which python3`` or evaluating ``sys.base_executable`` at
101+
find by e.g. running ``which python3`` or evaluating ``sys._base_executable`` at
102102
the Python REPL. (These instructions are for a non-framework build of Python.
103103
Framework builds may need to be configured differently.)
104104

0 commit comments

Comments
 (0)