]> granicus.if.org Git - python/commitdiff
The semantics of PyList_Check() and PyDict_Check() changed at 2.2, along
authorAndrew MacIntyre <andymac@bullseye.apana.org.au>
Fri, 26 Dec 2003 00:02:23 +0000 (00:02 +0000)
committerAndrew MacIntyre <andymac@bullseye.apana.org.au>
Fri, 26 Dec 2003 00:02:23 +0000 (00:02 +0000)
with most other concrete object checks, but the docs weren't brought into
line.

PyList_CheckExact() was added at 2.2 but never documented.

backport candidate.

Include/dictobject.h

index 554b82e5a30f464d9c08c8943cf8c7da5570b055..7fa400a5b272eea7c6105f11f9317dda71fd0a53 100644 (file)
@@ -87,6 +87,7 @@ struct _dictobject {
 PyAPI_DATA(PyTypeObject) PyDict_Type;
 
 #define PyDict_Check(op) PyObject_TypeCheck(op, &PyDict_Type)
+#define PyList_CheckExact(op) ((op)->ob_type == &PyDict_Type)
 
 PyAPI_FUNC(PyObject *) PyDict_New(void);
 PyAPI_FUNC(PyObject *) PyDict_GetItem(PyObject *mp, PyObject *key);