]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-136769: Include fixed-width integers in the fundamental data types table...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 19 Jul 2025 10:25:37 +0000 (12:25 +0200)
committerGitHub <noreply@github.com>
Sat, 19 Jul 2025 10:25:37 +0000 (10:25 +0000)
gh-136769: Include fixed-width integers in the fundamental data types table (GH-136784)

Fixed-sized types, like ``c_int32``, are currently missing from the fundamental data types table
in the ``ctypes`` documentation. This commit adds them, and  notes that ``c_[u]int8`` is an alias
of ``c_[u]byte``.
(cherry picked from commit acefb978dcb5dd554e3c49a3015ee5c2ad6bfda1)

Co-authored-by: Sina Zel taat <111974143+SZeltaat@users.noreply.github.com>
Doc/library/ctypes.rst

index 648652b7352761ac2fbbd1baeffa6e52d6efaf62..911e7cb2668a29d5c66b47e493518e1a75a1a0ee 100644 (file)
@@ -232,8 +232,24 @@ Fundamental data types
 +----------------------+------------------------------------------+----------------------------+
 | :class:`c_int`       | :c:expr:`int`                            | int                        |
 +----------------------+------------------------------------------+----------------------------+
+| :class:`c_int8`      | :c:type:`int8_t`                         | int                        |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_int16`     | :c:type:`int16_t`                        | int                        |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_int32`     | :c:type:`int32_t`                        | int                        |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_int64`     | :c:type:`int64_t`                        | int                        |
++----------------------+------------------------------------------+----------------------------+
 | :class:`c_uint`      | :c:expr:`unsigned int`                   | int                        |
 +----------------------+------------------------------------------+----------------------------+
+| :class:`c_uint8`     | :c:type:`uint8_t`                        | int                        |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_uint16`    | :c:type:`uint16_t`                       | int                        |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_uint32`    | :c:type:`uint32_t`                       | int                        |
++----------------------+------------------------------------------+----------------------------+
+| :class:`c_uint64`    | :c:type:`uint64_t`                       | int                        |
++----------------------+------------------------------------------+----------------------------+
 | :class:`c_long`      | :c:expr:`long`                           | int                        |
 +----------------------+------------------------------------------+----------------------------+
 | :class:`c_ulong`     | :c:expr:`unsigned long`                  | int                        |
@@ -2348,7 +2364,7 @@ These are the fundamental ctypes data types:
 
 .. class:: c_int8
 
-   Represents the C 8-bit :c:expr:`signed int` datatype.  Usually an alias for
+   Represents the C 8-bit :c:expr:`signed int` datatype.  It is an alias for
    :class:`c_byte`.
 
 
@@ -2423,7 +2439,7 @@ These are the fundamental ctypes data types:
 
 .. class:: c_uint8
 
-   Represents the C 8-bit :c:expr:`unsigned int` datatype.  Usually an alias for
+   Represents the C 8-bit :c:expr:`unsigned int` datatype.  It is an alias for
    :class:`c_ubyte`.