summaryrefslogtreecommitdiff
path: root/Include/dictobject.h
diff options
context:
space:
mode:
authorAndrew MacIntyre <andymac@bullseye.apana.org.au>2003-12-26 00:20:53 +0000
committerAndrew MacIntyre <andymac@bullseye.apana.org.au>2003-12-26 00:20:53 +0000
commit3fd3d9d694148ff08c7e0d02fceb85b0ad3fc5de (patch)
treeb0bb37457f1cc05aeff84e99b3df9e0614862306 /Include/dictobject.h
parentf3bb9bba21d80d78cdcfd453df1eccca3c2163b2 (diff)
downloadcpython-3fd3d9d694148ff08c7e0d02fceb85b0ad3fc5de.tar.gz
At 2.2, the Py<type>_Check() family of API functions (macros) changed
semantics to include subtypes. Most concrete object APIs then had a Py<type>_CheckExact() macro added to test for an object's type not including subtypes. The PyDict_CheckExact() macro wasn't created at that time, so I've added it for API completeness/symmetry - even though nobody has complained about its absence in the time since 2.2 was released. Not a backport candidate.
Diffstat (limited to 'Include/dictobject.h')
-rw-r--r--Include/dictobject.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/Include/dictobject.h b/Include/dictobject.h
index 554b82e5a3..7fa400a5b2 100644
--- a/Include/dictobject.h
+++ b/Include/dictobject.h
@@ -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);