summaryrefslogtreecommitdiffstats
path: root/Modules/xxsubtype.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-09-20 21:45:26 (GMT)
committerGuido van Rossum <guido@python.org>2001-09-20 21:45:26 (GMT)
commit32d34c809f5971f79462dcb7d0f536d46e624acc (patch)
tree29d97883adf68d8112d55c94eca8f4fb93048628 /Modules/xxsubtype.c
parenta56b42b1ba646170d5476e8925c56e2266b37f98 (diff)
downloadcpython-32d34c809f5971f79462dcb7d0f536d46e624acc.zip
cpython-32d34c809f5971f79462dcb7d0f536d46e624acc.tar.gz
cpython-32d34c809f5971f79462dcb7d0f536d46e624acc.tar.bz2
Add optional docstrings to getset descriptors. Fortunately, there's
no backwards compatibility to worry about, so I just pushed the 'closure' struct member to the back -- it's never used in the current code base (I may eliminate it, but that's more work because the getter and setter signatures would have to change.) As examples, I added actual docstrings to the getset attributes of a few types: file.closed, xxsubtype.spamdict.state.
Diffstat (limited to 'Modules/xxsubtype.c')
-rw-r--r--Modules/xxsubtype.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/xxsubtype.c b/Modules/xxsubtype.c
index cdf6d07..ae2b619 100644
--- a/Modules/xxsubtype.c
+++ b/Modules/xxsubtype.c
@@ -55,8 +55,9 @@ spamlist_state_get(spamlistobject *self)
return PyInt_FromLong(self->state);
}
-static struct getsetlist spamlist_getsets[] = {
- {"state", (getter)spamlist_state_get, NULL, NULL},
+static PyGetSetDef spamlist_getsets[] = {
+ {"state", (getter)spamlist_state_get, NULL,
+ "an int variable for demonstration purposes"},
{0}
};