diff options
author | Andrew MacIntyre <andymac@bullseye.apana.org.au> | 2003-12-26 00:20:53 (GMT) |
---|---|---|
committer | Andrew MacIntyre <andymac@bullseye.apana.org.au> | 2003-12-26 00:20:53 (GMT) |
commit | e99990f9e1b63ff10e18ed31359f774376b41968 (patch) | |
tree | 2b763c8c84e340fd81fa29fa34657e56c04ef3c2 /Include | |
parent | 6f3a24d0b373b4b35e832d6816c0b425188cbd5f (diff) | |
download | cpython-e99990f9e1b63ff10e18ed31359f774376b41968.zip cpython-e99990f9e1b63ff10e18ed31359f774376b41968.tar.gz cpython-e99990f9e1b63ff10e18ed31359f774376b41968.tar.bz2 |
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')
-rw-r--r-- | Include/dictobject.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Include/dictobject.h b/Include/dictobject.h index 554b82e..7fa400a 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); |