Skip to content

Commit 4594f5a

Browse files
Docs: fix API names, references, and examples (#161072)
Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent 4e0677a commit 4594f5a

27 files changed

Lines changed: 52 additions & 48 deletions

‎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/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()

‎Doc/library/configparser.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,7 @@ ConfigParser Objects
12511251
Comments in the original configuration file are not preserved when
12521252
writing the configuration back.
12531253
What is considered a comment, depends on the given values for
1254-
*comment_prefix* and *inline_comment_prefix*.
1254+
*comment_prefixes* and *inline_comment_prefixes*.
12551255

12561256

12571257
.. method:: remove_option(section, option)

0 commit comments

Comments
 (0)