Skip to content

Commit

Permalink
[3.10] gh-93738: Documentation C syntax (:c:type: to :c:expr:, misc. …
Browse files Browse the repository at this point in the history
…cases) (GH-97775) (#97891)

(cherry picked from commit 6b3d4db)

Co-authored-by: Adam Turner <[email protected]>
  • Loading branch information
ambv and AA-Turner authored Oct 5, 2022
1 parent 4245764 commit d99ea4c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Doc/c-api/file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Doc/c-api/structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions Doc/whatsnew/2.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Misc/NEWS.d/3.8.0a4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit d99ea4c

Please sign in to comment.