summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/intro.rst
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-08-13 20:11:50 (GMT)
committerGitHub <noreply@github.com>2020-08-13 20:11:50 (GMT)
commit474652fe9346382dbf793f20b671eb74668bebde (patch)
treee090a5b591783461601032795851e8b32d7f63e9 /Doc/c-api/intro.rst
parent0eb9deb4a62e6d9daa82bc2f67d1075864ca8ece (diff)
downloadcpython-474652fe9346382dbf793f20b671eb74668bebde.zip
cpython-474652fe9346382dbf793f20b671eb74668bebde.tar.gz
cpython-474652fe9346382dbf793f20b671eb74668bebde.tar.bz2
bpo-40204, doc: Fix syntax of C variables (GH-21846)
For example, fix the following Sphinx 3 errors: Doc/c-api/buffer.rst:102: WARNING: Error in declarator or parameters Invalid C declaration: Expected identifier in nested name. [error at 5] void \*obj -----^ Doc/c-api/arg.rst:130: WARNING: Unparseable C cross-reference: 'PyObject*' Invalid C declaration: Expected end of definition. [error at 8] PyObject* --------^ The modified documentation is compatible with Sphinx 2 and Sphinx 3.
Diffstat (limited to 'Doc/c-api/intro.rst')
-rw-r--r--Doc/c-api/intro.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/c-api/intro.rst b/Doc/c-api/intro.rst
index e89a788..7ca8693 100644
--- a/Doc/c-api/intro.rst
+++ b/Doc/c-api/intro.rst
@@ -229,13 +229,13 @@ Objects, Types and Reference Counts
.. index:: object: type
Most Python/C API functions have one or more arguments as well as a return value
-of type :c:type:`PyObject\*`. This type is a pointer to an opaque data type
+of type :c:type:`PyObject*`. This type is a pointer to an opaque data type
representing an arbitrary Python object. Since all Python object types are
treated the same way by the Python language in most situations (e.g.,
assignments, scope rules, and argument passing), it is only fitting that they
should be represented by a single C type. Almost all Python objects live on the
heap: you never declare an automatic or static variable of type
-:c:type:`PyObject`, only pointer variables of type :c:type:`PyObject\*` can be
+:c:type:`PyObject`, only pointer variables of type :c:type:`PyObject*` can be
declared. The sole exception are the type objects; since these must never be
deallocated, they are typically static :c:type:`PyTypeObject` objects.
@@ -496,7 +496,7 @@ Types
There are few other data types that play a significant role in the Python/C
API; most are simple C types such as :c:type:`int`, :c:type:`long`,
-:c:type:`double` and :c:type:`char\*`. A few structure types are used to
+:c:type:`double` and :c:type:`char*`. A few structure types are used to
describe static tables used to list the functions exported by a module or the
data attributes of a new object type, and another is used to describe the value
of a complex number. These will be discussed together with the functions that