Skip to content

Commit fe47a43

Browse files
miss-islingtonmethaneStanFromIreland
authored
Docs: fix API names, references, and examples (GH-161072)
(cherry picked from commit 4594f5a) Co-authored-by: Inada Naoki <songofacandy@gmail.com> Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent 0262ca1 commit fe47a43

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
@@ -168,7 +168,7 @@ UTF-8 encoded string. See :ref:`Configuration Options <pyinitconfig-opts>`.
168168
Get a string list configuration option as an array of
169169
null-terminated UTF-8 encoded strings.
170170
171-
* Set *\*length* and *\*value*, and return ``0`` on success.
171+
* Set *\*length* and *\*items*, and return ``0`` on success.
172172
* Set an error in *config* and return ``-1`` on error.
173173
174174
On success, the string list must be released with
@@ -1939,7 +1939,7 @@ PyConfig
19391939
If equals to zero, ignore the :ref:`environment variables
19401940
<using-on-envvars>`.
19411941
1942-
Set to ``0`` by the :option:`-E` environment variable.
1942+
Set to ``0`` by the :option:`-E` command-line option.
19431943
19441944
Default: ``1`` in Python config and ``0`` in isolated config.
19451945

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -873,9 +873,9 @@ Process-wide parameters
873873
formed from the "official" name of the operating system, converted to lower
874874
case, followed by the major revision number; e.g., for Solaris 2.x, which is
875875
also known as SunOS 5.x, the value is ``'sunos5'``. On macOS, it is
876-
``'darwin'``. On Windows, it is ``'win'``. The returned string points into
877-
static storage; the caller should not modify its value. The value is available
878-
to Python code as ``sys.platform``.
876+
``'darwin'``. On Windows, it is ``'win32'``. The returned string points
877+
into static storage; the caller should not modify its value. The value is
878+
available to Python code as ``sys.platform``.
879879
880880
881881
.. 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
@@ -338,7 +338,7 @@ Creation and initialization slots
338338
339339
.. versionchanged:: 3.15
340340
341-
The *slots* argument may be a ``ModuleSpec``-like object, rather than
341+
The *spec* argument may be a ``ModuleSpec``-like object, rather than
342342
a true :py:class:`~importlib.machinery.ModuleSpec` instance.
343343
Note that previous versions of CPython did not enforce this.
344344

‎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
@@ -672,7 +672,7 @@ but need extra remarks for use as slots:
672672
673673
.. c:macro:: Py_tp_bases
674674
675-
:c:member:`Slot ID <PySlot.sl_id>` for type flags, used to set
675+
:c:member:`Slot ID <PySlot.sl_id>` for base types, used to set
676676
:c:member:`PyTypeObject.tp_bases`.
677677
678678
The slot can be set to a tuple of type objects which the newly created
@@ -810,7 +810,7 @@ They will continue to work, but new features will be added as slots for
810810
:c:macro:`Py_tp_metaclass` slot.
811811
812812
A non-``NULL`` *bases* argument corresponds to the :c:data:`Py_tp_bases`
813-
slot, and takes precedence over :c:data:`Py_tp_bases` and
813+
slot, and takes precedence over :c:data:`Py_tp_base` and
814814
:c:data:`Py_tp_bases` slots.
815815
816816
A non-``NULL`` *module* argument corresponds to the
@@ -981,7 +981,7 @@ They will continue to work, but new features will be added as slots for
981981
(PySlot){
982982
.sl_id=tpslot.slot,
983983
.sl_flags=PySlot_INTPTR | sub_static,
984-
.sl_ptr=tpslot.func
984+
.sl_ptr=tpslot.pfunc
985985
}
986986
987987
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)