Mercurial > cpython-lru_cache-weakref
diff Modules/_struct.c @ 56416:e759ca25701d legacy-trunk
Issue #7078: _struct.__doc__ was being ignored. Import it into struct.
Also add description of '?' struct format character. Thanks Gabriel
Genellina for the patch.
| author | Mark Dickinson <dickinsm@gmail.com> |
|---|---|
| date | Thu, 08 Oct 2009 15:54:10 +0000 |
| parents | 3dec3b77b787 |
| children | c2d9d50f37c5 |
line wrap: on
line diff
--- a/Modules/_struct.c Thu Oct 08 08:04:15 2009 +0000 +++ b/Modules/_struct.c Thu Oct 08 15:54:10 2009 +0000 @@ -1868,20 +1868,22 @@ /* Module initialization */ PyDoc_STRVAR(module_doc, -"Functions to convert between Python values and C structs.\n\ -Python strings are used to hold the data representing the C struct\n\ -and also as format strings to describe the layout of data in the C struct.\n\ +"Functions to convert between Python values and C structs represented\n\ +as Python strings. It uses format strings (explained below) as compact\n\ +descriptions of the lay-out of the C structs and the intended conversion\n\ +to/from Python values.\n\ \n\ The optional first format char indicates byte order, size and alignment:\n\ - @: native order, size & alignment (default)\n\ - =: native order, std. size & alignment\n\ - <: little-endian, std. size & alignment\n\ - >: big-endian, std. size & alignment\n\ - !: same as >\n\ + @: native order, size & alignment (default)\n\ + =: native order, std. size & alignment\n\ + <: little-endian, std. size & alignment\n\ + >: big-endian, std. size & alignment\n\ + !: same as >\n\ \n\ The remaining chars indicate types of args and must match exactly;\n\ these can be preceded by a decimal repeat count:\n\ x: pad byte (no data); c:char; b:signed byte; B:unsigned byte;\n\ + ?: _Bool (requires C99; if not available, char is used instead)\n\ h:short; H:unsigned short; i:int; I:unsigned int;\n\ l:long; L:unsigned long; f:float; d:double.\n\ Special cases (preceding decimal count indicates length):\n\
