Skip to content

Commit e99990f

Browse files
author
Andrew MacIntyre
committed
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.
1 parent 6f3a24d commit e99990f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Include/dictobject.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ struct _dictobject {
8787
PyAPI_DATA(PyTypeObject) PyDict_Type;
8888

8989
#define PyDict_Check(op) PyObject_TypeCheck(op, &PyDict_Type)
90+
#define PyList_CheckExact(op) ((op)->ob_type == &PyDict_Type)
9091

9192
PyAPI_FUNC(PyObject *) PyDict_New(void);
9293
PyAPI_FUNC(PyObject *) PyDict_GetItem(PyObject *mp, PyObject *key);

0 commit comments

Comments
 (0)