[Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.16.8.72,2.16.8.73
Guido van Rossum
gvanrossum@users.sourceforge.net
2001年7月31日 20:56:42 -0700
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv13600
Modified Files:
Tag: descr-branch
typeobject.c
Log Message:
Rip out again the 'x in type' support. Further newsgroup discussion
showed it was confusing. E.g. people tried "if x in [int, long]:
...".
Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.16.8.72
retrieving revision 2.16.8.73
diff -C2 -d -r2.16.8.72 -r2.16.8.73
*** typeobject.c 2001年07月31日 16:50:17 2.16.8.72
--- typeobject.c 2001年08月01日 03:56:39 2.16.8.73
***************
*** 783,806 ****
};
- static int
- type_contains(PyObject *type, PyObject *obj)
- {
- assert(PyType_Check(type));
- return PyType_IsSubtype(obj->ob_type, (PyTypeObject *)type);
- }
-
- static PySequenceMethods type_as_seq = {
- 0, /* sq_length */
- 0, /* sq_concat */
- 0, /* sq_repeat */
- 0, /* sq_item */
- 0, /* sq_slice */
- 0, /* sq_ass_item */
- 0, /* sq_ass_slice */
- type_contains, /* sq_contains */
- 0, /* sq_inplace_concat */
- 0, /* sq_inplace_repeat */
- };
-
static char type_doc[] =
"type(object) -> the object's type\n"
--- 783,786 ----
***************
*** 820,824 ****
(reprfunc)type_repr, /* tp_repr */
0, /* tp_as_number */
! &type_as_seq, /* tp_as_sequence */
0, /* tp_as_mapping */
(hashfunc)_Py_HashPointer, /* tp_hash */
--- 800,804 ----
(reprfunc)type_repr, /* tp_repr */
0, /* tp_as_number */
! 0, /* tp_as_sequence */
0, /* tp_as_mapping */
(hashfunc)_Py_HashPointer, /* tp_hash */