summaryrefslogtreecommitdiff
path: root/Doc/library/struct.rst
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-10-28 13:41:26 +0200
committerGitHub <noreply@github.com>2018-10-28 13:41:26 +0200
commit913876d824d969f8c7431e8a9d4610a9a11a786e (patch)
treef98ec4ccbb5f2db38d2ea62e1583745db2957c0b /Doc/library/struct.rst
parent95f68b10d5c9852ef4dcf5b9f2ae15fdf74e8f1c (diff)
downloadcpython-git-913876d824d969f8c7431e8a9d4610a9a11a786e.tar.gz
bpo-35054: Add yet more index entries for symbols. (GH-10121)
Diffstat (limited to 'Doc/library/struct.rst')
-rw-r--r--Doc/library/struct.rst14
1 files changed, 9 insertions, 5 deletions
diff --git a/Doc/library/struct.rst b/Doc/library/struct.rst
index 9ba404760a..1a0fd73c67 100644
--- a/Doc/library/struct.rst
+++ b/Doc/library/struct.rst
@@ -118,11 +118,11 @@ order, and properly aligned by skipping pad bytes if necessary (according to the
rules used by the C compiler).
.. index::
- single: @; in struct format strings
- single: =; in struct format strings
- single: <; in struct format strings
- single: >; in struct format strings
- single: !; in struct format strings
+ single: @ (at); in struct format strings
+ single: = (equals); in struct format strings
+ single: < (less); in struct format strings
+ single: > (greater); in struct format strings
+ single: ! (exclamation); in struct format strings
Alternatively, the first character of the format string can be used to indicate
the byte order, size and alignment of the packed data, according to the
@@ -247,6 +247,8 @@ platform-dependent.
Notes:
(1)
+ .. index:: single: ? (question mark); in struct format strings
+
The ``'?'`` conversion code corresponds to the :c:type:`_Bool` type defined by
C99. If this type is not available, it is simulated using a :c:type:`char`. In
standard mode, it is always represented by one byte.
@@ -329,6 +331,8 @@ are used. Note that for :func:`unpack`, the ``'p'`` format character consumes
``count`` bytes, but that the string returned can never contain more than 255
bytes.
+.. index:: single: ? (question mark); in struct format strings
+
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