Skip to content

Commit d99ea4c

Browse files
ambvAA-Turner
andauthored
[3.10] gh-93738: Documentation C syntax (:c:type: to :c:expr:, misc. cases) (GH-97775) (#97891)
(cherry picked from commit 6b3d4db) Co-authored-by: Adam Turner <[email protected]>
1 parent 4245764 commit d99ea4c

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

Doc/c-api/file.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ the :mod:`io` APIs instead.
6565
Overrides the normal behavior of :func:`io.open_code` to pass its parameter
6666
through the provided handler.
6767
68-
The handler is a function of type :c:type:`PyObject *(\*)(PyObject *path,
68+
The handler is a function of type :c:expr:`PyObject *(\*)(PyObject *path,
6969
void *userData)`, where *path* is guaranteed to be :c:type:`PyUnicodeObject`.
7070
7171
The *userData* pointer is passed into the hook function. Since hook

Doc/c-api/structures.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ the definition of all other Python objects.
9999
100100
Return a :term:`borrowed reference`.
101101
102-
The :c:func:`Py_SET_TYPE` function must be used to set an object type.
102+
Use the :c:func:`Py_SET_TYPE` function to set an object type.
103103
104104
105105
.. c:function:: int Py_IS_TYPE(PyObject *o, PyTypeObject *type)
@@ -137,7 +137,7 @@ the definition of all other Python objects.
137137
138138
Get the size of the Python object *o*.
139139
140-
The :c:func:`Py_SET_SIZE` function must be used to set an object size.
140+
Use the :c:func:`Py_SET_SIZE` function to set an object size.
141141
142142
143143
.. c:function:: void Py_SET_SIZE(PyVarObject *o, Py_ssize_t size)

Doc/whatsnew/2.4.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,7 +1453,7 @@ Some of the changes to Python's build process and to the C API are:
14531453
extension functions: :c:macro:`Py_RETURN_NONE`, :c:macro:`Py_RETURN_TRUE`, and
14541454
:c:macro:`Py_RETURN_FALSE`. (Contributed by Brett Cannon.)
14551455

1456-
* Another new macro, :c:macro:`Py_CLEAR(obj)`, decreases the reference count of
1456+
* Another new macro, :c:macro:`Py_CLEAR`, decreases the reference count of
14571457
*obj* and sets *obj* to the null pointer. (Contributed by Jim Fulton.)
14581458

14591459
* 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:
14641464
lookups without masking exceptions raised during the look-up process.
14651465
(Contributed by Raymond Hettinger.)
14661466

1467-
* The :c:macro:`Py_IS_NAN(X)` macro returns 1 if its float or double argument
1467+
* The :c:expr:`Py_IS_NAN(X)` macro returns 1 if its float or double argument
14681468
*X* is a NaN. (Contributed by Tim Peters.)
14691469

14701470
* C code can avoid unnecessary locking by using the new

Misc/NEWS.d/3.8.0a4.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,7 @@ the function is called twice.
13541354
.. nonce: pz-DIR
13551355
.. section: C API
13561356
1357-
:c:macro:`PyDoc_VAR(name)` and :c:macro:`PyDoc_STRVAR(name,str)` now create
1357+
:c:expr:`PyDoc_VAR(name)` and :c:expr:`PyDoc_STRVAR(name,str)` now create
13581358
``static const char name[]`` instead of ``static char name[]``. Patch by
13591359
Inada Naoki.
13601360

0 commit comments

Comments
 (0)