Author: Manuel Jacob
Branch: remove-dict-smm
Changeset: r64153:396dfccfd7be
Date: 2013-05-15 14:35 +0200
http://bitbucket.org/pypy/pypy/changeset/396dfccfd7be/

Log:    Return NotImplemented instead of raising a TypeError.

diff --git a/pypy/objspace/std/dictmultiobject.py 
b/pypy/objspace/std/dictmultiobject.py
--- a/pypy/objspace/std/dictmultiobject.py
+++ b/pypy/objspace/std/dictmultiobject.py
@@ -112,9 +112,7 @@
         if space.is_w(self, w_other):
             return space.w_True
         if not isinstance(w_other, W_DictMultiObject):
-            raise operationerrfmt(space.w_TypeError,
-                                  "Expected dict object, got %s",
-                                  space.type(w_other).getname(space))
+            return space.w_NotImplemented
 
         if self.length() != w_other.length():
             return space.w_False
@@ -132,9 +130,7 @@
 
     def descr_lt(self, space, w_other):
         if not isinstance(w_other, W_DictMultiObject):
-            raise operationerrfmt(space.w_TypeError,
-                                  "Expected dict object, got %s",
-                                  space.type(w_other).getname(space))
+            return space.w_NotImplemented
 
         # Different sizes, no problem
         if self.length() < w_other.length():
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to