Skip to content

Commit 1f66a03

Browse files
Docs: fix API names, references, and examples (GH-161072)
(cherry picked from commit 4594f5a) Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent 5dcf7f0 commit 1f66a03

22 files changed

Lines changed: 43 additions & 39 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
@@ -1936,7 +1936,7 @@ PyConfig
19361936
If equals to zero, ignore the :ref:`environment variables
19371937
<using-on-envvars>`.
19381938
1939-
Set to ``0`` by the :option:`-E` environment variable.
1939+
Set to ``0`` by the :option:`-E` command-line option.
19401940
19411941
Default: ``1`` in Python config and ``0`` in isolated config.
19421942

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -839,9 +839,9 @@ Process-wide parameters
839839
formed from the "official" name of the operating system, converted to lower
840840
case, followed by the major revision number; e.g., for Solaris 2.x, which is
841841
also known as SunOS 5.x, the value is ``'sunos5'``. On macOS, it is
842-
``'darwin'``. On Windows, it is ``'win'``. The returned string points into
843-
static storage; the caller should not modify its value. The value is available
844-
to Python code as ``sys.platform``.
842+
``'darwin'``. On Windows, it is ``'win32'``. The returned string points
843+
into static storage; the caller should not modify its value. The value is
844+
available to Python code as ``sys.platform``.
845845

846846

847847
.. 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
@@ -589,7 +589,7 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
589589
Macro for converting a Python integer into a process identifier.
590590
591591
This can be defined as an alias to :c:func:`PyLong_AsLong`,
592-
:c:func:`PyLong_FromLongLong`, or :c:func:`PyLong_AsInt`, depending on the
592+
:c:func:`PyLong_AsLongLong`, or :c:func:`PyLong_AsInt`, depending on the
593593
size of the system's PID type.
594594
595595
.. versionadded:: 3.2

‎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
@@ -460,7 +460,7 @@ available:
460460

461461
.. object:: python.function.return(str filename, str funcname, int lineno, frameptr)
462462

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

‎Doc/library/cmd.rst‎

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

114114

115-
.. method:: Cmd.onecmd(str)
115+
.. method:: Cmd.onecmd(line)
116116

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

125125

126126
.. method:: Cmd.emptyline()

‎Doc/library/configparser.rst‎

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

12581258

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

‎Doc/library/ctypes.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2835,7 +2835,7 @@ These are the fundamental ctypes data types:
28352835
Represents the C :c:expr:`unsigned long long` datatype. The constructor
28362836
accepts an optional integer initializer; no overflow checking is done.
28372837
On platforms where ``sizeof(long long) == sizeof(long)`` it is an alias
2838-
to :class:`c_long`.
2838+
to :class:`c_ulong`.
28392839

28402840

28412841
.. class:: c_ushort

‎Doc/library/optparse.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1783,7 +1783,7 @@ where
17831783

17841784
``parser.values``
17851785
the object where option values are by default stored (an instance of
1786-
optparse.OptionValues). This lets callbacks use the same mechanism as the
1786+
optparse.Values). This lets callbacks use the same mechanism as the
17871787
rest of :mod:`!optparse` for storing option values; you don't need to mess
17881788
around with globals or closures. You can also access or modify the
17891789
value(s) of any options already encountered on the command-line.

‎Doc/library/sys.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ always available. Unless explicitly noted otherwise, all variables are read-only
251251
you might bind it to a function that expects additional arguments
252252
(positional and/or keyword). The built-in ``breakpoint()`` function passes
253253
its ``*args`` and ``**kws`` straight through. Whatever
254-
``breakpointhooks()`` returns is returned from ``breakpoint()``.
254+
``breakpointhook()`` returns is returned from ``breakpoint()``.
255255

256256
The default implementation first consults the environment variable
257257
:envvar:`PYTHONBREAKPOINT`. If that is set to ``"0"`` then this function

0 commit comments

Comments
 (0)