[Python-checkins] python/dist/src/Objects dictobject.c,2.134,2.135
rhettinger@users.sourceforge.net
rhettinger@users.sourceforge.net
2002年12月07日 00:10:53 -0800
- Previous message: [Python-checkins] python/nondist/sandbox/datetime doc.txt,1.22,1.23 obj_datetime.c,1.29,1.30 test_both.py,1.47,1.48 test_datetime.py,1.54,1.55
- Next message: [Python-checkins] python/dist/src/Lib/test test_types.py,1.43,1.44
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1:/tmp/cvs-serv19914/Objects
Modified Files:
dictobject.c
Log Message:
Remove assumption that cls is a subclass of dict.
Simplifies the code and gets Just van Rossum's example to work.
Index: dictobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/dictobject.c,v
retrieving revision 2.134
retrieving revision 2.135
diff -C2 -d -r2.134 -r2.135
*** dictobject.c 4 Dec 2002 07:32:25 -0000 2.134
--- dictobject.c 7 Dec 2002 08:10:51 -0000 2.135
***************
*** 980,989 ****
if (d == NULL)
return NULL;
- if (!PyDict_Check(d)) {
- Py_DECREF(d);
- PyErr_SetString(PyExc_TypeError,
- "class constructor must return a subclass of dict");
- return NULL;
- }
it = PyObject_GetIter(seq);
--- 980,983 ----
***************
*** 1000,1004 ****
break;
}
! status = PyDict_SetItem(d, key, value);
Py_DECREF(key);
if (status < 0)
--- 994,998 ----
break;
}
! status = PyObject_SetItem(d, key, value);
Py_DECREF(key);
if (status < 0)
- Previous message: [Python-checkins] python/nondist/sandbox/datetime doc.txt,1.22,1.23 obj_datetime.c,1.29,1.30 test_both.py,1.47,1.48 test_datetime.py,1.54,1.55
- Next message: [Python-checkins] python/dist/src/Lib/test test_types.py,1.43,1.44
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]