]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.10] gh-93738: Documentation C syntax (:c:type: to :c:expr:, misc. cases) (GH-97775...
authorŁukasz Langa <lukasz@langa.pl>
Wed, 5 Oct 2022 15:19:38 +0000 (08:19 -0700)
committerGitHub <noreply@github.com>
Wed, 5 Oct 2022 15:19:38 +0000 (08:19 -0700)
(cherry picked from commit 6b3d4db02edc5883a7e7cbe088711edaef0d9853)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Doc/c-api/file.rst
Doc/c-api/structures.rst
Doc/whatsnew/2.4.rst
Misc/NEWS.d/3.8.0a4.rst

index 145dfe4962ac8fe9bfb9aaea5302fe0317c6fe30..745d892be7ea8935996c3587540b208957255ea0 100644 (file)
@@ -65,7 +65,7 @@ the :mod:`io` APIs instead.
    Overrides the normal behavior of :func:`io.open_code` to pass its parameter
    through the provided handler.
 
-   The handler is a function of type :c:type:`PyObject *(\*)(PyObject *path,
+   The handler is a function of type :c:expr:`PyObject *(\*)(PyObject *path,
    void *userData)`, where *path* is guaranteed to be :c:type:`PyUnicodeObject`.
 
    The *userData* pointer is passed into the hook function. Since hook
index c1ff90fb8a641675c3d32f143c0aa9262d81f3ab..0697747456547e3e384a52e5d0a2cc1461bdc74a 100644 (file)
@@ -99,7 +99,7 @@ the definition of all other Python objects.
 
    Return a :term:`borrowed reference`.
 
-   The :c:func:`Py_SET_TYPE` function must be used to set an object type.
+   Use the :c:func:`Py_SET_TYPE` function to set an object type.
 
 
 .. c:function:: int Py_IS_TYPE(PyObject *o, PyTypeObject *type)
@@ -137,7 +137,7 @@ the definition of all other Python objects.
 
    Get the size of the Python object *o*.
 
-   The :c:func:`Py_SET_SIZE` function must be used to set an object size.
+   Use the :c:func:`Py_SET_SIZE` function to set an object size.
 
 
 .. c:function:: void Py_SET_SIZE(PyVarObject *o, Py_ssize_t size)
index ddfac1a3f4e63a4077727e85bd8bba41909406d9..61f9eb43243cebefc52dfcb6fd8ff3cc9b479058 100644 (file)
@@ -1453,7 +1453,7 @@ Some of the changes to Python's build process and to the C API are:
   extension functions: :c:macro:`Py_RETURN_NONE`, :c:macro:`Py_RETURN_TRUE`, and
   :c:macro:`Py_RETURN_FALSE`. (Contributed by Brett Cannon.)
 
-* Another new macro, :c:macro:`Py_CLEAR(obj)`,  decreases the reference count of
+* Another new macro, :c:macro:`Py_CLEAR`,  decreases the reference count of
   *obj* and sets *obj* to the null pointer.  (Contributed by Jim Fulton.)
 
 * A new function, ``PyTuple_Pack(N, obj1, obj2, ..., objN)``, constructs
@@ -1464,7 +1464,7 @@ Some of the changes to Python's build process and to the C API are:
   lookups without masking exceptions raised during the look-up process.
   (Contributed by Raymond Hettinger.)
 
-* The :c:macro:`Py_IS_NAN(X)` macro returns 1 if  its float or double argument
+* The :c:expr:`Py_IS_NAN(X)` macro returns 1 if  its float or double argument
   *X* is a NaN.   (Contributed by Tim Peters.)
 
 * C code can avoid unnecessary locking by using the new
index fc952fa9dcc8e1b3ac2d8d8c09b878aad880b322..5250d82f65e7bcde208df1fbf8b8dc0f1cac4fa4 100644 (file)
@@ -1354,7 +1354,7 @@ the function is called twice.
 .. nonce: pz-DIR
 .. section: C API
 
-:c:macro:`PyDoc_VAR(name)` and :c:macro:`PyDoc_STRVAR(name,str)` now create
+:c:expr:`PyDoc_VAR(name)` and :c:expr:`PyDoc_STRVAR(name,str)` now create
 ``static const char name[]`` instead of ``static char name[]``.  Patch by
 Inada Naoki.