Skip to content

Commit dde4563

Browse files
AA-Turnermpage
authored andcommitted
pythongh-93738: Documentation C syntax (:c:type:FILE -> :c:expr:FILE) (python#97769)
:c:type:`FILE` -> :c:expr:`FILE`
1 parent cb408c6 commit dde4563

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Doc/c-api/file.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ File Objects
88
.. index:: object: file
99

1010
These APIs are a minimal emulation of the Python 2 C API for built-in file
11-
objects, which used to rely on the buffered I/O (:c:type:`FILE*`) support
11+
objects, which used to rely on the buffered I/O (:c:expr:`FILE*`) support
1212
from the C standard library. In Python 3, files and streams use the new
1313
:mod:`io` module, which defines several layers over the low-level unbuffered
1414
I/O of the operating system. The functions described below are

Doc/c-api/marshal.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The following functions allow marshalled values to be read back in.
4343
4444
.. c:function:: long PyMarshal_ReadLongFromFile(FILE *file)
4545
46-
Return a C :c:type:`long` from the data stream in a :c:type:`FILE*` opened
46+
Return a C :c:type:`long` from the data stream in a :c:expr:`FILE*` opened
4747
for reading. Only a 32-bit value can be read in using this function,
4848
regardless of the native size of :c:type:`long`.
4949
@@ -53,7 +53,7 @@ The following functions allow marshalled values to be read back in.
5353
5454
.. c:function:: int PyMarshal_ReadShortFromFile(FILE *file)
5555
56-
Return a C :c:type:`short` from the data stream in a :c:type:`FILE*` opened
56+
Return a C :c:type:`short` from the data stream in a :c:expr:`FILE*` opened
5757
for reading. Only a 16-bit value can be read in using this function,
5858
regardless of the native size of :c:type:`short`.
5959
@@ -63,7 +63,7 @@ The following functions allow marshalled values to be read back in.
6363
6464
.. c:function:: PyObject* PyMarshal_ReadObjectFromFile(FILE *file)
6565
66-
Return a Python object from the data stream in a :c:type:`FILE*` opened for
66+
Return a Python object from the data stream in a :c:expr:`FILE*` opened for
6767
reading.
6868
6969
On error, sets the appropriate exception (:exc:`EOFError`, :exc:`ValueError`
@@ -72,7 +72,7 @@ The following functions allow marshalled values to be read back in.
7272
7373
.. c:function:: PyObject* PyMarshal_ReadLastObjectFromFile(FILE *file)
7474
75-
Return a Python object from the data stream in a :c:type:`FILE*` opened for
75+
Return a Python object from the data stream in a :c:expr:`FILE*` opened for
7676
reading. Unlike :c:func:`PyMarshal_ReadObjectFromFile`, this function
7777
assumes that no further objects will be read from the file, allowing it to
7878
aggressively load file data into memory so that the de-serialization can

Doc/c-api/veryhigh.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ parameter. The available start symbols are :const:`Py_eval_input`,
1616
:const:`Py_file_input`, and :const:`Py_single_input`. These are described
1717
following the functions which accept them as parameters.
1818

19-
Note also that several of these functions take :c:type:`FILE*` parameters. One
20-
particular issue which needs to be handled carefully is that the :c:type:`FILE`
19+
Note also that several of these functions take :c:expr:`FILE*` parameters. One
20+
particular issue which needs to be handled carefully is that the :c:expr:`FILE`
2121
structure for different C libraries can be different and incompatible. Under
2222
Windows (at least), it is possible for dynamically linked extensions to actually
23-
use different libraries, so care should be taken that :c:type:`FILE*` parameters
23+
use different libraries, so care should be taken that :c:expr:`FILE*` parameters
2424
are only passed to these functions if it is certain that they were created by
2525
the same library that the Python runtime is using.
2626

0 commit comments

Comments
 (0)