]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] Fix minor typos and wording in C API docs (GH-140955) (#140966)
authorHugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Tue, 4 Nov 2025 07:46:08 +0000 (09:46 +0200)
committerGitHub <noreply@github.com>
Tue, 4 Nov 2025 07:46:08 +0000 (09:46 +0200)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
12 files changed:
Doc/c-api/cell.rst
Doc/c-api/datetime.rst
Doc/c-api/descriptor.rst
Doc/c-api/init_config.rst
Doc/c-api/mapping.rst
Doc/c-api/marshal.rst
Doc/c-api/memory.rst
Doc/c-api/module.rst
Doc/c-api/monitoring.rst
Doc/c-api/object.rst
Doc/c-api/tuple.rst
Doc/c-api/veryhigh.rst

index 61eb994c37094604e15563813c2cb7ec470c543c..2501ed9580df898319569e2804642517db60ac56 100644 (file)
@@ -7,7 +7,7 @@ Cell Objects
 
 "Cell" objects are used to implement variables referenced by multiple scopes.
 For each such variable, a cell object is created to store the value; the local
-variables of each stack frame that references the value contains a reference to
+variables of each stack frame that references the value contain a reference to
 the cells from outer scopes which also use that variable.  When the value is
 accessed, the value contained in the cell is used instead of the cell object
 itself.  This de-referencing of the cell object requires support from the
index d2d4d5309c7098442d5c501052825761f0754cb8..f311aad5f15499e8ee91e3fce4bf648f44aff288 100644 (file)
@@ -46,7 +46,7 @@ macros.
 
 .. c:var:: PyTypeObject PyDateTime_DeltaType
 
-   This instance of :c:type:`PyTypeObject` represents Python type for
+   This instance of :c:type:`PyTypeObject` represents the Python type for
    the difference between two datetime values;
    it is the same object as :class:`datetime.timedelta` in the Python layer.
 
index b32c113e5f04573a04fd53f20c267cbd79897079..ff0df575279d9642d13482f3e2a5bd8359bce16b 100644 (file)
@@ -32,7 +32,7 @@ found in the dictionary of type objects.
 
 .. c:function:: int PyDescr_IsData(PyObject *descr)
 
-   Return non-zero if the descriptor objects *descr* describes a data attribute, or
+   Return non-zero if the descriptor object *descr* describes a data attribute, or
    ``0`` if it describes a method.  *descr* must be a descriptor object; there is
    no error checking.
 
index e1931655618b1c928828924708644b8ce53eadd0..424d7de70891521f611e1916308b8120ab53a5ae 100644 (file)
@@ -102,7 +102,7 @@ Error Handling
    * Set *\*err_msg* and return ``1`` if an error is set.
    * Set *\*err_msg* to ``NULL`` and return ``0`` otherwise.
 
-   An error message is an UTF-8 encoded string.
+   An error message is a UTF-8 encoded string.
 
    If *config* has an exit code, format the exit code as an error
    message.
index 1f55c0aa955c75ba3fec58c0725dfb4bc562ea7a..2476ebb9b69dce0b00ffecd568fecba36d60ede6 100644 (file)
@@ -102,7 +102,7 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and
 
    .. note::
 
-      Exceptions which occur when this calls :meth:`~object.__getitem__`
+      Exceptions which occur when this calls the :meth:`~object.__getitem__`
       method are silently ignored.
       For proper error handling, use :c:func:`PyMapping_HasKeyWithError`,
       :c:func:`PyMapping_GetOptionalItem` or :c:func:`PyObject_GetItem()` instead.
@@ -116,7 +116,7 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and
 
    .. note::
 
-      Exceptions that occur when this calls :meth:`~object.__getitem__`
+      Exceptions that occur when this calls the :meth:`~object.__getitem__`
       method or while creating the temporary :class:`str`
       object are silently ignored.
       For proper error handling, use :c:func:`PyMapping_HasKeyStringWithError`,
index 61218a1bf6f171600b5515f66e4dcd543502341b..668a163b2df5a113706e44b5a36427ca9347137d 100644 (file)
@@ -82,7 +82,7 @@ The following functions allow marshalled values to be read back in.
    assumes that no further objects will be read from the file, allowing it to
    aggressively load file data into memory so that the de-serialization can
    operate from data in memory rather than reading a byte at a time from the
-   file.  Only use these variant if you are certain that you won't be reading
+   file.  Only use this variant if you are certain that you won't be reading
    anything else from the file.
 
    On error, sets the appropriate exception (:exc:`EOFError`, :exc:`ValueError`
index df1bb0ce370919e3009f58040c0607bd7ff287d4..2395898010214d9c48314aa738d292aee49f3d44 100644 (file)
@@ -102,7 +102,7 @@ All allocating functions belong to one of three different "domains" (see also
 strategies and are optimized for different purposes. The specific details on
 how every domain allocates memory or what internal functions each domain calls
 is considered an implementation detail, but for debugging purposes a simplified
-table can be found at :ref:`here <default-memory-allocators>`.
+table can be found at :ref:`default-memory-allocators`.
 The APIs used to allocate and free a block of memory must be from the same domain.
 For example, :c:func:`PyMem_Free` must be used to free memory allocated using :c:func:`PyMem_Malloc`.
 
index 1089bc34369fae036572087adb1f99199eacdf70..976fa4a2fa0da87b684def55f094b2abf0b6665b 100644 (file)
@@ -103,7 +103,7 @@ Module Objects
    created, or ``NULL`` if the module wasn't created from a definition.
 
    On error, return ``NULL`` with an exception set.
-   Use :c:func:`PyErr_Occurred` to tell this case apart from a mising
+   Use :c:func:`PyErr_Occurred` to tell this case apart from a missing
    :c:type:`!PyModuleDef`.
 
 
index 7926148302af0b593faaca6a94cbd57092f17dbb..b0227c2f4faf15ccc7e47be5b1dd908ac1e76102 100644 (file)
@@ -136,7 +136,7 @@ Managing the Monitoring State
 -----------------------------
 
 Monitoring states can be managed with the help of monitoring scopes. A scope
-would typically correspond to a python function.
+would typically correspond to a Python function.
 
 .. c:function:: int PyMonitoring_EnterScope(PyMonitoringState *state_array, uint64_t *version, const uint8_t *event_types, Py_ssize_t length)
 
index 1e39505588f6fdf9f6a8cd33d524c76ab73a2724..e215027330fb4353ea5fb18bb8b57c6fceeac5b6 100644 (file)
@@ -73,7 +73,7 @@ Object Protocol
 
    Flag to be used with multiple functions that print the object (like
    :c:func:`PyObject_Print` and :c:func:`PyFile_WriteObject`).
-   If passed, these function would use the :func:`str` of the object
+   If passed, these functions use the :func:`str` of the object
    instead of the :func:`repr`.
 
 
index 815afddad19df1a292f25b16ef221143ce57c724..be960243f763664a40be4ffc02216d222ea9eaf4 100644 (file)
@@ -48,7 +48,7 @@ Tuple Objects
 .. c:function:: Py_ssize_t PyTuple_Size(PyObject *p)
 
    Take a pointer to a tuple object, and return the size of that tuple.
-   On error, return ``-1`` and with an exception set.
+   On error, return ``-1`` with an exception set.
 
 
 .. c:function:: Py_ssize_t PyTuple_GET_SIZE(PyObject *p)
index ee0595a9e089c903e80f58bd4eb8c04b2f8849a3..0b2b55b6387bd1681fddc0019514cd5422f31b87 100644 (file)
@@ -140,7 +140,7 @@ the same library that the Python runtime is using.
    interpreter prompt is about to become idle and wait for user input
    from the terminal.  The return value is ignored.  Overriding this
    hook can be used to integrate the interpreter's prompt with other
-   event loops, as done in the :file:`Modules/_tkinter.c` in the
+   event loops, as done in :file:`Modules/_tkinter.c` in the
    Python source code.
 
    .. versionchanged:: 3.12