]> granicus.if.org Git - python/commit
Add optional docstrings to member descriptors. For backwards
authorGuido van Rossum <guido@python.org>
Thu, 20 Sep 2001 20:46:19 +0000 (20:46 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 20 Sep 2001 20:46:19 +0000 (20:46 +0000)
commit6f7993765ac0989b5d13084240797913627a31d8
tree51dd234049db1eb78c6dd25d23ec687bf91d817c
parente0af35eb694179d8da5d3208ffdfb92e5356335f
Add optional docstrings to member descriptors.  For backwards
compatibility, this required all places where an array of "struct
memberlist" structures was declared that is referenced from a type's
tp_members slot to change the type of the structure to PyMemberDef;
"struct memberlist" is now only used by old code that still calls
PyMember_Get/Set.  The code in PyObject_GenericGetAttr/SetAttr now
calls the new APIs PyMember_GetOne/SetOne, which take a PyMemberDef
argument.

As examples, I added actual docstrings to the attributes of a few
types: file, complex, instance method, super, and xxsubtype.spamlist.

Also converted the symtable to new style getattr.
17 files changed:
Include/descrobject.h
Include/object.h
Include/structmember.h
Modules/xxsubtype.c
Objects/classobject.c
Objects/complexobject.c
Objects/descrobject.c
Objects/fileobject.c
Objects/frameobject.c
Objects/funcobject.c
Objects/moduleobject.c
Objects/sliceobject.c
Objects/typeobject.c
Python/ceval.c
Python/compile.c
Python/structmember.c
Python/symtable.c