diff options
author | Thomas Heller <theller@ctypes.org> | 2008-03-05 15:34:29 (GMT) |
---|---|---|
committer | Thomas Heller <theller@ctypes.org> | 2008-03-05 15:34:29 (GMT) |
commit | f3c0559b5e164e112d408c30e41ac2f2b06c2c85 (patch) | |
tree | 94b533057dd3841925b256ad7564f715307245a7 /Doc | |
parent | 78b8f4458d2189cc6c26874eec19c19a6df7ed06 (diff) | |
download | cpython-f3c0559b5e164e112d408c30e41ac2f2b06c2c85.zip cpython-f3c0559b5e164e112d408c30e41ac2f2b06c2c85.tar.gz cpython-f3c0559b5e164e112d408c30e41ac2f2b06c2c85.tar.bz2 |
Issue 1872: Changed the struct module typecode from 't' to '?', for
compatibility with PEP3118.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/struct.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/library/struct.rst b/Doc/library/struct.rst index d0960ed..8a9d2ae 100644 --- a/Doc/library/struct.rst +++ b/Doc/library/struct.rst @@ -77,7 +77,7 @@ Python values should be obvious given their types: +--------+-------------------------+--------------------+-------+ | ``B`` | :ctype:`unsigned char` | integer | | +--------+-------------------------+--------------------+-------+ -| ``t`` | :ctype:`_Bool` | bool | \(1) | +| ``?`` | :ctype:`_Bool` | bool | \(1) | +--------+-------------------------+--------------------+-------+ | ``h`` | :ctype:`short` | integer | | +--------+-------------------------+--------------------+-------+ @@ -110,7 +110,7 @@ Python values should be obvious given their types: Notes: (1) - The ``'t'`` conversion code corresponds to the :ctype:`_Bool` type defined by + The ``'?'`` conversion code corresponds to the :ctype:`_Bool` type defined by C99. If this type is not available, it is simulated using a :ctype:`char`. In standard mode, it is always represented by one byte. @@ -158,7 +158,7 @@ may be used. For example, the Alpha and Merced processors use 64-bit pointer values, meaning a Python long integer will be used to hold the pointer; other platforms use 32-bit pointers and will use a Python integer. -For the ``'t'`` format character, the return value is either :const:`True` or +For the ``'?'`` format character, the return value is either :const:`True` or :const:`False`. When packing, the truth value of the argument object is used. Either 0 or 1 in the native or standard bool representation will be packed, and any non-zero value will be True when unpacking. |