diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-06-12 18:20:47 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-06-12 18:20:47 (GMT) |
commit | 7a70b2c45021b47e29195f7256425adb55ef7182 (patch) | |
tree | 415f503e539cdad7dde8fd8a4c0f8422ce69c370 /Doc/library/struct.rst | |
parent | ac1a50b56a9835501b8ec69800e39dcf27d51c67 (diff) | |
download | cpython-7a70b2c45021b47e29195f7256425adb55ef7182.zip cpython-7a70b2c45021b47e29195f7256425adb55ef7182.tar.gz cpython-7a70b2c45021b47e29195f7256425adb55ef7182.tar.bz2 |
Issue #8469: add standard sizes to struct docs table.
Diffstat (limited to 'Doc/library/struct.rst')
-rw-r--r-- | Doc/library/struct.rst | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/Doc/library/struct.rst b/Doc/library/struct.rst index 2f48a77..73bfd57 100644 --- a/Doc/library/struct.rst +++ b/Doc/library/struct.rst @@ -87,46 +87,46 @@ Format Characters Format characters have the following meaning; the conversion between C and Python values should be obvious given their types: -+--------+-------------------------+--------------------+------------+ -| Format | C Type | Python | Notes | -+========+=========================+====================+============+ -| ``x`` | pad byte | no value | | -+--------+-------------------------+--------------------+------------+ -| ``c`` | :ctype:`char` | bytes of length 1 | | -+--------+-------------------------+--------------------+------------+ -| ``b`` | :ctype:`signed char` | integer | \(1),\(4) | -+--------+-------------------------+--------------------+------------+ -| ``B`` | :ctype:`unsigned char` | integer | \(4) | -+--------+-------------------------+--------------------+------------+ -| ``?`` | :ctype:`_Bool` | bool | \(2) | -+--------+-------------------------+--------------------+------------+ -| ``h`` | :ctype:`short` | integer | \(4) | -+--------+-------------------------+--------------------+------------+ -| ``H`` | :ctype:`unsigned short` | integer | \(4) | -+--------+-------------------------+--------------------+------------+ -| ``i`` | :ctype:`int` | integer | \(4) | -+--------+-------------------------+--------------------+------------+ -| ``I`` | :ctype:`unsigned int` | integer | \(4) | -+--------+-------------------------+--------------------+------------+ -| ``l`` | :ctype:`long` | integer | \(4) | -+--------+-------------------------+--------------------+------------+ -| ``L`` | :ctype:`unsigned long` | integer | \(4) | -+--------+-------------------------+--------------------+------------+ -| ``q`` | :ctype:`long long` | integer | \(3), \(4) | -+--------+-------------------------+--------------------+------------+ -| ``Q`` | :ctype:`unsigned long | integer | \(3), \(4) | -| | long` | | | -+--------+-------------------------+--------------------+------------+ -| ``f`` | :ctype:`float` | float | | -+--------+-------------------------+--------------------+------------+ -| ``d`` | :ctype:`double` | float | | -+--------+-------------------------+--------------------+------------+ -| ``s`` | :ctype:`char[]` | bytes | \(1) | -+--------+-------------------------+--------------------+------------+ -| ``p`` | :ctype:`char[]` | bytes | \(1) | -+--------+-------------------------+--------------------+------------+ -| ``P`` | :ctype:`void \*` | integer | | -+--------+-------------------------+--------------------+------------+ ++--------+-------------------------+--------------------+----------------+------------+ +| Format | C Type | Python type | Standard size | Notes | ++========+=========================+====================+================+============+ +| ``x`` | pad byte | no value | | | ++--------+-------------------------+--------------------+----------------+------------+ +| ``c`` | :ctype:`char` | bytes of length 1 | 1 | | ++--------+-------------------------+--------------------+----------------+------------+ +| ``b`` | :ctype:`signed char` | integer | 1 | \(1),\(4) | ++--------+-------------------------+--------------------+----------------+------------+ +| ``B`` | :ctype:`unsigned char` | integer | 1 | \(4) | ++--------+-------------------------+--------------------+----------------+------------+ +| ``?`` | :ctype:`_Bool` | bool | 1 | \(2) | ++--------+-------------------------+--------------------+----------------+------------+ +| ``h`` | :ctype:`short` | integer | 2 | \(4) | ++--------+-------------------------+--------------------+----------------+------------+ +| ``H`` | :ctype:`unsigned short` | integer | 2 | \(4) | ++--------+-------------------------+--------------------+----------------+------------+ +| ``i`` | :ctype:`int` | integer | 4 | \(4) | ++--------+-------------------------+--------------------+----------------+------------+ +| ``I`` | :ctype:`unsigned int` | integer | 4 | \(4) | ++--------+-------------------------+--------------------+----------------+------------+ +| ``l`` | :ctype:`long` | integer | 4 | \(4) | ++--------+-------------------------+--------------------+----------------+------------+ +| ``L`` | :ctype:`unsigned long` | integer | 4 | \(4) | ++--------+-------------------------+--------------------+----------------+------------+ +| ``q`` | :ctype:`long long` | integer | 8 | \(3), \(4) | ++--------+-------------------------+--------------------+----------------+------------+ +| ``Q`` | :ctype:`unsigned long | integer | 8 | \(3), \(4) | +| | long` | | | | ++--------+-------------------------+--------------------+----------------+------------+ +| ``f`` | :ctype:`float` | float | 4 | | ++--------+-------------------------+--------------------+----------------+------------+ +| ``d`` | :ctype:`double` | float | 8 | | ++--------+-------------------------+--------------------+----------------+------------+ +| ``s`` | :ctype:`char[]` | bytes | | \(1) | ++--------+-------------------------+--------------------+----------------+------------+ +| ``p`` | :ctype:`char[]` | bytes | | \(1) | ++--------+-------------------------+--------------------+----------------+------------+ +| ``P`` | :ctype:`void \*` | integer | | | ++--------+-------------------------+--------------------+----------------+------------+ Notes: |