mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
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.
This commit is contained in:
parent
a56b42b1ba
commit
32d34c809f
10 changed files with 43 additions and 26 deletions
|
@ -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}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue