[Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.16.8.33,2.16.8.34
Guido van Rossum
gvanrossum@users.sourceforge.net
Wed, 06 Jun 2001 10:17:16 -0700
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv772
Modified Files:
Tag: descr-branch
typeobject.c
Log Message:
Improve the docstring and argument checking error messages slightly.
Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.16.8.33
retrieving revision 2.16.8.34
diff -C2 -r2.16.8.33 -r2.16.8.34
*** typeobject.c 2001/06/06 15:40:38 2.16.8.33
--- typeobject.c 2001/06/06 17:17:14 2.16.8.34
***************
*** 219,223 ****
/* Check arguments */
! if (!PyArg_ParseTupleAndKeywords(args, kwds, "SOO", kwlist,
&name, &bases, &dict))
return -1;
--- 219,223 ----
/* Check arguments */
! if (!PyArg_ParseTupleAndKeywords(args, kwds, "SOO:type", kwlist,
&name, &bases, &dict))
return -1;
***************
*** 444,448 ****
/* Check arguments (again?!?! yes, alas -- we need the bases!) */
! if (!PyArg_ParseTupleAndKeywords(args, kwds, "SOO", kwlist,
&name, &bases, &dict))
return NULL;
--- 444,448 ----
/* Check arguments (again?!?! yes, alas -- we need the bases!) */
! if (!PyArg_ParseTupleAndKeywords(args, kwds, "SOO:type", kwlist,
&name, &bases, &dict))
return NULL;
***************
*** 486,489 ****
--- 486,493 ----
}
+ static char type_doc[] =
+ "type(object) -> the object's type\n"
+ "type(name, bases, dict) -> a new type";
+
PyTypeObject PyType_Type = {
PyObject_HEAD_INIT(&PyType_Type)
***************
*** 508,512 ****
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT, /* tp_flags */
! "Define the behavior of a particular type of object.", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
--- 512,516 ----
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT, /* tp_flags */
! type_doc, /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */