summaryrefslogtreecommitdiffstats
path: root/Lib/_abcoll.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-05-21 21:05:45 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-05-21 21:05:45 (GMT)
commit8e13de6725943ce7e80bf96bc5f6bd330be428a7 (patch)
treeba78e6e3db39d5021be7742439a0d9052dbfbc10 /Lib/_abcoll.py
parent4e0bd6d40bd7a15f437a0b35ee4f714e53f483f1 (diff)
downloadcpython-8e13de6725943ce7e80bf96bc5f6bd330be428a7.zip
cpython-8e13de6725943ce7e80bf96bc5f6bd330be428a7.tar.gz
cpython-8e13de6725943ce7e80bf96bc5f6bd330be428a7.tar.bz2
Merged revisions 81417 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81417 | benjamin.peterson | 2010-05-21 15:55:22 -0500 (Fri, 21 May 2010) | 9 lines Merged revisions 81414 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81414 | benjamin.peterson | 2010-05-21 15:51:45 -0500 (Fri, 21 May 2010) | 1 line return NotImplemented from Mapping when comparing to a non-mapping #8729 ........ ................
Diffstat (limited to 'Lib/_abcoll.py')
-rw-r--r--Lib/_abcoll.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/_abcoll.py b/Lib/_abcoll.py
index a60d91e..e9f06a5 100644
--- a/Lib/_abcoll.py
+++ b/Lib/_abcoll.py
@@ -376,8 +376,9 @@ class Mapping(Sized, Iterable, Container):
return ValuesView(self)
def __eq__(self, other):
- return isinstance(other, Mapping) and \
- dict(self.items()) == dict(other.items())
+ if not isinstance(other, Mapping):
+ return NotImplemented
+ return dict(self.items()) == dict(other.items())
def __ne__(self, other):
return not (self == other)