summaryrefslogtreecommitdiffstats
path: root/Objects/setobject.c
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 /Objects/setobject.c
parent52716c94be3fa7b7df0160bc1cf5b04ec99f9c72 (diff)
downloadcpython-7759a0cd76105e6685008da7a1e2deb6e0d37c38.zip
cpython-7759a0cd76105e6685008da7a1e2deb6e0d37c38.tar.gz
cpython-7759a0cd76105e6685008da7a1e2deb6e0d37c38.tar.bz2
Factor-out common code with a new macro
Diffstat (limited to 'Objects/setobject.c')
-rw-r--r--Objects/setobject.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c
index ee11b9f..4b4213a 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -2158,7 +2158,7 @@ PySet_Size(PyObject *anyset)
int
PySet_Clear(PyObject *set)
{
- if (!PyType_IsSubtype(Py_TYPE(set), &PySet_Type)) {
+ if (!PySet_Check(set)) {
PyErr_BadInternalCall();
return -1;
}
@@ -2178,7 +2178,7 @@ PySet_Contains(PyObject *anyset, PyObject *key)
int
PySet_Discard(PyObject *set, PyObject *key)
{
- if (!PyType_IsSubtype(Py_TYPE(set), &PySet_Type)) {
+ if (!PySet_Check(set)) {
PyErr_BadInternalCall();
return -1;
}
@@ -2229,7 +2229,7 @@ _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, long *hash)
PyObject *
PySet_Pop(PyObject *set)
{
- if (!PyType_IsSubtype(Py_TYPE(set), &PySet_Type)) {
+ if (!PySet_Check(set)) {
PyErr_BadInternalCall();
return NULL;
}
@@ -2239,7 +2239,7 @@ PySet_Pop(PyObject *set)
int
_PySet_Update(PyObject *set, PyObject *iterable)
{
- if (!PyType_IsSubtype(Py_TYPE(set), &PySet_Type)) {
+ if (!PySet_Check(set)) {
PyErr_BadInternalCall();
return -1;
}