changeset 31:c62ed518e5c8

Fix repor and add type-check to __eq__.
author Simon Cross <hodgestar@gmail.com>
date Sun, 01 Sep 2013 16:14:35 +0200
parents 9d17bf13f800
children 0e49648f8d74
files nagslang/mutators.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/nagslang/mutators.py	Sun Sep 01 16:12:23 2013 +0200
+++ b/nagslang/mutators.py	Sun Sep 01 16:14:35 2013 +0200
@@ -16,9 +16,11 @@
         return hash((self._func, self._args))
 
     def __eq__(self, other):
+        if not isinstance(other, Mutator):
+            return NotImplemented
         return (self._func is other._func) and (self._args == other._args)
 
-    def __repor__(self):
+    def __repr__(self):
         return '<%s %r>' % (self.__class__.__name__, self._args)