[Python-checkins] CVS: python/dist/src/Modules xxsubtype.c,2.5,2.6
Guido van Rossum
gvanrossum@users.sourceforge.net
2001年9月20日 13:46:20 -0700
- Previous message: [Python-checkins] CVS: python/dist/src/Include descrobject.h,2.3,2.4 object.h,2.90,2.91 structmember.h,2.17,2.18
- Next message: [Python-checkins] CVS: python/dist/src/Objects classobject.c,2.148,2.149 complexobject.c,2.46,2.47 descrobject.c,2.11,2.12 fileobject.c,2.128,2.129 frameobject.c,2.56,2.57 funcobject.c,2.43,2.44 moduleobject.c,2.37,2.38 sliceobject.c,2.8,2.9 typeobject.c,2.65,2.66
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv25248/Modules
Modified Files:
xxsubtype.c
Log Message:
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.
Index: xxsubtype.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/xxsubtype.c,v
retrieving revision 2.5
retrieving revision 2.6
diff -C2 -d -r2.5 -r2.6
*** xxsubtype.c 2001年08月16日 09:10:42 2.5
--- xxsubtype.c 2001年09月20日 20:46:18 2.6
***************
*** 149,154 ****
}
! static struct memberlist spamdict_members[] = {
! {"state", T_INT, offsetof(spamdictobject, state), READONLY},
{0}
};
--- 149,155 ----
}
! static PyMemberDef spamdict_members[] = {
! {"state", T_INT, offsetof(spamdictobject, state), READONLY,
! "an int variable for demonstration purposes"},
{0}
};
- Previous message: [Python-checkins] CVS: python/dist/src/Include descrobject.h,2.3,2.4 object.h,2.90,2.91 structmember.h,2.17,2.18
- Next message: [Python-checkins] CVS: python/dist/src/Objects classobject.c,2.148,2.149 complexobject.c,2.46,2.47 descrobject.c,2.11,2.12 fileobject.c,2.128,2.129 frameobject.c,2.56,2.57 funcobject.c,2.43,2.44 moduleobject.c,2.37,2.38 sliceobject.c,2.8,2.9 typeobject.c,2.65,2.66
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]