summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2007-02-01 21:02:59 (GMT)
committerRaymond Hettinger <python@rcn.com>2007-02-01 21:02:59 (GMT)
commitdb67aef672ba51e7d01b1f095d5342fc2e67ca1a (patch)
treeba596cf5f54fecf59c46daad2d0f92ac8cef496e /Objects
parent129bd52146c2380a4887c6bbf066113a195c60da (diff)
downloadcpython-db67aef672ba51e7d01b1f095d5342fc2e67ca1a.zip
cpython-db67aef672ba51e7d01b1f095d5342fc2e67ca1a.tar.gz
cpython-db67aef672ba51e7d01b1f095d5342fc2e67ca1a.tar.bz2
Bug #1648179: set.update() not recognizing __iter__ overrides in dict subclasses.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/setobject.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c
index f038ee3..5b5fb3d 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -915,7 +915,7 @@ set_update_internal(PySetObject *so, PyObject *other)
if (PyAnySet_Check(other))
return set_merge(so, other);
- if (PyDict_Check(other)) {
+ if (PyDict_CheckExact(other)) {
PyObject *value;
Py_ssize_t pos = 0;
while (PyDict_Next(other, &pos, &key, &value)) {
@@ -1363,7 +1363,7 @@ set_difference(PySetObject *so, PyObject *other)
setentry *entry;
Py_ssize_t pos = 0;
- if (!PyAnySet_Check(other) && !PyDict_Check(other)) {
+ if (!PyAnySet_Check(other) && !PyDict_CheckExact(other)) {
result = set_copy(so);
if (result == NULL)
return NULL;
@@ -1377,7 +1377,7 @@ set_difference(PySetObject *so, PyObject *other)
if (result == NULL)
return NULL;
- if (PyDict_Check(other)) {
+ if (PyDict_CheckExact(other)) {
while (set_next(so, &pos, &entry)) {
setentry entrycopy;
entrycopy.hash = entry->hash;
@@ -1450,7 +1450,7 @@ set_symmetric_difference_update(PySetObject *so, PyObject *other)
if ((PyObject *)so == other)
return set_clear(so);
- if (PyDict_Check(other)) {
+ if (PyDict_CheckExact(other)) {
PyObject *value;
int rv;
while (PyDict_Next(other, &pos, &key, &value)) {