summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-01-28 21:47:42 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-01-28 21:47:42 (GMT)
commit7759a0cd76105e6685008da7a1e2deb6e0d37c38 (patch)
tree505e72617a73d473b7ea83dff2df7aa65b042a87 /Include
parent52716c94be3fa7b7df0160bc1cf5b04ec99f9c72 (diff)
downloadcpython-7759a0cd76105e6685008da7a1e2deb6e0d37c38.zip
cpython-7759a0cd76105e6685008da7a1e2deb6e0d37c38.tar.gz
cpython-7759a0cd76105e6685008da7a1e2deb6e0d37c38.tar.bz2
Factor-out common code with a new macro
Diffstat (limited to 'Include')
-rw-r--r--Include/setobject.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/Include/setobject.h b/Include/setobject.h
index 2739d62..fc32367 100644
--- a/Include/setobject.h
+++ b/Include/setobject.h
@@ -73,6 +73,8 @@ PyAPI_DATA(PyTypeObject) PyFrozenSet_Type;
(Py_TYPE(ob) == &PySet_Type || Py_TYPE(ob) == &PyFrozenSet_Type || \
PyType_IsSubtype(Py_TYPE(ob), &PySet_Type) || \
PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type))
+#define PySet_Check(ob) \
+ (Py_TYPE(ob) == &PySet_Type || PyType_IsSubtype(Py_TYPE(ob), &PySet_Type))
PyAPI_FUNC(PyObject *) PySet_New(PyObject *);
PyAPI_FUNC(PyObject *) PyFrozenSet_New(PyObject *);