Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 33e4537

Browse filesBrowse files
miss-islingtonAA-Turner
authored andcommitted
[3.11] gh-93738: Documentation C syntax (Use c:struct) (GH-97772) (#97869)
Use `c:struct` (cherry picked from commit a0f5599) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
1 parent 2af31cf commit 33e4537
Copy full SHA for 33e4537

File tree

6 files changed

+15
-15
lines changed
Filter options

6 files changed

+15
-15
lines changed

‎Doc/c-api/import.rst

Copy file name to clipboardExpand all lines: Doc/c-api/import.rst
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ Importing Modules
243243
UTF-8 encoded string instead of a Unicode object.
244244
245245
246-
.. c:type:: struct _frozen
246+
.. c:struct:: _frozen
247247
248248
.. index:: single: freeze utility
249249
@@ -265,7 +265,7 @@ Importing Modules
265265
266266
.. c:var:: const struct _frozen* PyImport_FrozenModules
267267
268-
This pointer is initialized to point to an array of :c:type:`struct _frozen`
268+
This pointer is initialized to point to an array of :c:struct:`_frozen`
269269
records, terminated by one whose members are all ``NULL`` or zero. When a frozen
270270
module is imported, it is searched in this table. Third-party code could play
271271
tricks with this to provide a dynamically created collection of frozen modules.
@@ -281,7 +281,7 @@ Importing Modules
281281
:c:func:`Py_Initialize`.
282282
283283
284-
.. c:type:: struct _inittab
284+
.. c:struct:: _inittab
285285
286286
Structure describing a single entry in the list of built-in modules. Each of
287287
these structures gives the name and initialization function for a module built

‎Doc/c-api/veryhigh.rst

Copy file name to clipboardExpand all lines: Doc/c-api/veryhigh.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ the same library that the Python runtime is using.
8282
.. c:function:: int PyRun_SimpleString(const char *command)
8383
8484
This is a simplified interface to :c:func:`PyRun_SimpleStringFlags` below,
85-
leaving the :c:type:`PyCompilerFlags`\* argument set to ``NULL``.
85+
leaving the :c:struct:`PyCompilerFlags`\* argument set to ``NULL``.
8686
8787
8888
.. c:function:: int PyRun_SimpleStringFlags(const char *command, PyCompilerFlags *flags)
@@ -338,7 +338,7 @@ the same library that the Python runtime is using.
338338
interpreter loop.
339339
340340
341-
.. c:type:: struct PyCompilerFlags
341+
.. c:struct:: PyCompilerFlags
342342
343343
This is the structure used to hold compiler flags. In cases where code is only
344344
being compiled, it is passed as ``int flags``, and in cases where code is being

‎Doc/library/ctypes.rst

Copy file name to clipboardExpand all lines: Doc/library/ctypes.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ An extended example which also demonstrates the use of pointers accesses the
10741074

10751075
Quoting the docs for that value:
10761076

1077-
This pointer is initialized to point to an array of :c:type:`struct _frozen`
1077+
This pointer is initialized to point to an array of :c:struct:`_frozen`
10781078
records, terminated by one whose members are all ``NULL`` or zero. When a frozen
10791079
module is imported, it is searched in this table. Third-party code could play
10801080
tricks with this to provide a dynamically created collection of frozen modules.
@@ -1093,7 +1093,7 @@ size, we show only how this table can be read with :mod:`ctypes`::
10931093
...
10941094
>>>
10951095

1096-
We have defined the :c:type:`struct _frozen` data type, so we can get the pointer
1096+
We have defined the :c:struct:`_frozen` data type, so we can get the pointer
10971097
to the table::
10981098

10991099
>>> FrozenTable = POINTER(struct_frozen)

‎Doc/library/socket.rst

Copy file name to clipboardExpand all lines: Doc/library/socket.rst
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ The :mod:`socket` module also offers various network-related services:
10121012
Convert an IPv4 address from dotted-quad string format (for example,
10131013
'123.45.67.89') to 32-bit packed binary format, as a bytes object four characters in
10141014
length. This is useful when conversing with a program that uses the standard C
1015-
library and needs objects of type :c:type:`struct in_addr`, which is the C type
1015+
library and needs objects of type :c:struct:`in_addr`, which is the C type
10161016
for the 32-bit packed binary this function returns.
10171017

10181018
:func:`inet_aton` also accepts strings with less than three dots; see the
@@ -1031,7 +1031,7 @@ The :mod:`socket` module also offers various network-related services:
10311031
Convert a 32-bit packed IPv4 address (a :term:`bytes-like object` four
10321032
bytes in length) to its standard dotted-quad string representation (for example,
10331033
'123.45.67.89'). This is useful when conversing with a program that uses the
1034-
standard C library and needs objects of type :c:type:`struct in_addr`, which
1034+
standard C library and needs objects of type :c:struct:`in_addr`, which
10351035
is the C type for the 32-bit packed binary data this function takes as an
10361036
argument.
10371037

@@ -1048,8 +1048,8 @@ The :mod:`socket` module also offers various network-related services:
10481048

10491049
Convert an IP address from its family-specific string format to a packed,
10501050
binary format. :func:`inet_pton` is useful when a library or network protocol
1051-
calls for an object of type :c:type:`struct in_addr` (similar to
1052-
:func:`inet_aton`) or :c:type:`struct in6_addr`.
1051+
calls for an object of type :c:struct:`in_addr` (similar to
1052+
:func:`inet_aton`) or :c:struct:`in6_addr`.
10531053

10541054
Supported values for *address_family* are currently :const:`AF_INET` and
10551055
:const:`AF_INET6`. If the IP address string *ip_string* is invalid,
@@ -1069,8 +1069,8 @@ The :mod:`socket` module also offers various network-related services:
10691069
bytes) to its standard, family-specific string representation (for
10701070
example, ``'7.10.0.5'`` or ``'5aef:2b::8'``).
10711071
:func:`inet_ntop` is useful when a library or network protocol returns an
1072-
object of type :c:type:`struct in_addr` (similar to :func:`inet_ntoa`) or
1073-
:c:type:`struct in6_addr`.
1072+
object of type :c:struct:`in_addr` (similar to :func:`inet_ntoa`) or
1073+
:c:struct:`in6_addr`.
10741074

10751075
Supported values for *address_family* are currently :const:`AF_INET` and
10761076
:const:`AF_INET6`. If the bytes object *packed_ip* is not the correct

‎Doc/whatsnew/3.11.rst

Copy file name to clipboardExpand all lines: Doc/whatsnew/3.11.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1823,7 +1823,7 @@ Porting to Python 3.11
18231823
fields of the result from the exception instance (the ``value`` field).
18241824
(Contributed by Irit Katriel in :issue:`45711`.)
18251825

1826-
* :c:type:`_frozen` has a new ``is_package`` field to indicate whether
1826+
* :c:struct:`_frozen` has a new ``is_package`` field to indicate whether
18271827
or not the frozen module is a package. Previously, a negative value
18281828
in the ``size`` field was the indicator. Now only non-negative values
18291829
be used for ``size``.

‎Doc/whatsnew/3.8.rst

Copy file name to clipboardExpand all lines: Doc/whatsnew/3.8.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2011,7 +2011,7 @@ Changes in the Python API
20112011
Changes in the C API
20122012
--------------------
20132013

2014-
* The :c:type:`PyCompilerFlags` structure got a new *cf_feature_version*
2014+
* The :c:struct:`PyCompilerFlags` structure got a new *cf_feature_version*
20152015
field. It should be initialized to ``PY_MINOR_VERSION``. The field is ignored
20162016
by default, and is used if and only if ``PyCF_ONLY_AST`` flag is set in
20172017
*cf_flags*.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.