summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-10-08 16:02:50 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2009-10-08 16:02:50 (GMT)
commit015fa03058edbe2947a791f64461abf062267d0d (patch)
tree22bd3437c9874dfe872496a3423c9264010faf15
parent6bf5a2e85bc549647cd050a5e38e70f81db80c5a (diff)
downloadcpython-015fa03058edbe2947a791f64461abf062267d0d.zip
cpython-015fa03058edbe2947a791f64461abf062267d0d.tar.gz
cpython-015fa03058edbe2947a791f64461abf062267d0d.tar.bz2
Merged revisions 75284 via svnmerge from
svn+ssh://pythondev@www.python.org/python/branches/py3k ................ r75284 | mark.dickinson | 2009-10-08 16:59:20 +0100 (Thu, 08 Oct 2009) | 11 lines 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. ........ ................
-rw-r--r--Lib/struct.py1
-rw-r--r--Misc/NEWS2
-rw-r--r--Modules/_struct.c14
3 files changed, 11 insertions, 6 deletions
diff --git a/Lib/struct.py b/Lib/struct.py
index 3784c05..b022355 100644
--- a/Lib/struct.py
+++ b/Lib/struct.py
@@ -1,2 +1,3 @@
from _struct import *
from _struct import _clearcache
+from _struct import __doc__
diff --git a/Misc/NEWS b/Misc/NEWS
index 96ad164..4e55a61 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -74,6 +74,8 @@ Library
Extension Modules
-----------------
+- Issue #7078: Set struct.__doc__ from _struct.__doc__.
+
- Issue #6848: Fix curses module build failure on OS X 10.6.
Tests
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 3e0ab31..6a89d8c 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -1900,18 +1900,20 @@ static struct PyMethodDef module_functions[] = {
PyDoc_STRVAR(module_doc,
"Functions to convert between Python values and C structs.\n\
Python bytes objects 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\
+and also as format strings (explained below) to describe the layout of data\n\
+in the C struct.\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\