summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2007-02-08 00:50:39 (GMT)
committerRaymond Hettinger <python@rcn.com>2007-02-08 00:50:39 (GMT)
commit0e7a632f57ed26079af1f388626311f1b9c1227c (patch)
tree56082813803dff7fa368c3eb58848365b3f808f7 /Objects
parent6d121f168cca9df59fe4b3908cecbc346e185650 (diff)
downloadcpython-0e7a632f57ed26079af1f388626311f1b9c1227c.zip
cpython-0e7a632f57ed26079af1f388626311f1b9c1227c.tar.gz
cpython-0e7a632f57ed26079af1f388626311f1b9c1227c.tar.bz2
Bypass set specific optimizations for set and frozenset subclasses.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/setobject.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c
index 5b5fb3d..fc9d823 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -912,7 +912,7 @@ set_update_internal(PySetObject *so, PyObject *other)
{
PyObject *key, *it;
- if (PyAnySet_Check(other))
+ if (PyAnySet_CheckExact(other))
return set_merge(so, other);
if (PyDict_CheckExact(other)) {
@@ -1190,7 +1190,7 @@ set_intersection(PySetObject *so, PyObject *other)
if (result == NULL)
return NULL;
- if (PyAnySet_Check(other)) {
+ if (PyAnySet_CheckExact(other)) {
Py_ssize_t pos = 0;
setentry *entry;
@@ -1314,7 +1314,7 @@ set_difference_update_internal(PySetObject *so, PyObject *other)
if ((PyObject *)so == other)
return set_clear_internal(so);
- if (PyAnySet_Check(other)) {
+ if (PyAnySet_CheckExact(other)) {
setentry *entry;
Py_ssize_t pos = 0;
@@ -1363,7 +1363,7 @@ set_difference(PySetObject *so, PyObject *other)
setentry *entry;
Py_ssize_t pos = 0;
- if (!PyAnySet_Check(other) && !PyDict_CheckExact(other)) {
+ if (!PyAnySet_CheckExact(other) && !PyDict_CheckExact(other)) {
result = set_copy(so);
if (result == NULL)
return NULL;
@@ -1472,7 +1472,7 @@ set_symmetric_difference_update(PySetObject *so, PyObject *other)
Py_RETURN_NONE;
}
- if (PyAnySet_Check(other)) {
+ if (PyAnySet_CheckExact(other)) {
Py_INCREF(other);
otherset = (PySetObject *)other;
} else {
@@ -1555,7 +1555,7 @@ set_issubset(PySetObject *so, PyObject *other)
setentry *entry;
Py_ssize_t pos = 0;
- if (!PyAnySet_Check(other)) {
+ if (!PyAnySet_CheckExact(other)) {
PyObject *tmp, *result;
tmp = make_new_set(&PySet_Type, other);
if (tmp == NULL)
@@ -1584,7 +1584,7 @@ set_issuperset(PySetObject *so, PyObject *other)
{
PyObject *tmp, *result;
- if (!PyAnySet_Check(other)) {
+ if (!PyAnySet_CheckExact(other)) {
tmp = make_new_set(&PySet_Type, other);
if (tmp == NULL)
return NULL;