Author: Armin Rigo <[email protected]>
Branch: py3.5
Changeset: r88778:3cce9c2e561f
Date: 2016-11-30 16:45 +0100
http://bitbucket.org/pypy/pypy/changeset/3cce9c2e561f/

Log:    tweak SimpleNamespace.__eq__ and __ne__

diff --git a/pypy/module/sys/app.py b/pypy/module/sys/app.py
--- a/pypy/module/sys/app.py
+++ b/pypy/module/sys/app.py
@@ -131,8 +131,14 @@
             sns_recurse.discard(ident)
 
     def __eq__(self, other):
-        return (issubclass(type(other), SimpleNamespace) and
-                self.__dict__ == other.__dict__)
+        if issubclass(type(other), SimpleNamespace):
+            return self.__dict__ == other.__dict__
+        return NotImplemented
+
+    def __ne__(self, other):
+        if issubclass(type(other), SimpleNamespace):
+            return self.__dict__ != other.__dict__
+        return NotImplemented
 
 sns_recurse = set()
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to