diff Objects/moduleobject.c @ 20012:3faabf54b8b8 legacy-trunk

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.
author Guido van Rossum <guido@python.org>
date Thu, 20 Sep 2001 20:46:19 +0000
parents fd48a55ac364
children 2983b54256c7
line wrap: on
line diff
--- a/Objects/moduleobject.c	Thu Sep 20 20:43:28 2001 +0000
+++ b/Objects/moduleobject.c	Thu Sep 20 20:46:19 2001 +0000
@@ -9,7 +9,7 @@
 	PyObject *md_dict;
 } PyModuleObject;
 
-struct memberlist module_members[] = {
+PyMemberDef module_members[] = {
 	{"__dict__", T_OBJECT, offsetof(PyModuleObject, md_dict), READONLY},
 	{0}
 };