diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-10-27 17:00:03 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-10-27 17:00:03 (GMT) |
commit | 9b12553a87c54c9e92b79e934d892e77584fc492 (patch) | |
tree | f54e547fbf83fee4567ff353bc38e3ee3a48764d /Modules | |
parent | 5e672d0ed685d96f93794e31c032e6259f997812 (diff) | |
download | cpython-9b12553a87c54c9e92b79e934d892e77584fc492.zip cpython-9b12553a87c54c9e92b79e934d892e77584fc492.tar.gz cpython-9b12553a87c54c9e92b79e934d892e77584fc492.tar.bz2 |
Merged revisions 75283 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r75283 | mark.dickinson | 2009-10-08 16:54:10 +0100 (Thu, 08 Oct 2009) | 4 lines
Issue #7078: _struct.__doc__ was being ignored. Import it into struct.
Also add description of '?' struct format character. Thanks Gabriel
Genellina for the patch.
........
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_struct.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c index e567627..ff1aca2 100644 --- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -2042,20 +2042,22 @@ static struct PyMethodDef module_functions[] = { /* 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\ |