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:
Guido van Rossum 2001-09-20 21:45:26 +00:00
parent a56b42b1ba
commit 32d34c809f
10 changed files with 43 additions and 26 deletions

View file

@ -91,7 +91,7 @@ type_dynamic(PyTypeObject *type, void *context)
return res;
}
struct getsetlist type_getsets[] = {
PyGetSetDef type_getsets[] = {
{"__name__", (getter)type_name, NULL, NULL},
{"__module__", (getter)type_module, NULL, NULL},
{"__dict__", (getter)type_dict, NULL, NULL},
@ -659,7 +659,7 @@ subtype_dict(PyObject *obj, void *context)
}
}
struct getsetlist subtype_getsets[] = {
PyGetSetDef subtype_getsets[] = {
{"__dict__", subtype_dict, NULL, NULL},
{0},
};
@ -1282,7 +1282,7 @@ add_members(PyTypeObject *type, PyMemberDef *memb)
}
static int
add_getset(PyTypeObject *type, struct getsetlist *gsp)
add_getset(PyTypeObject *type, PyGetSetDef *gsp)
{
PyObject *dict = type->tp_defined;