From fefd403fc3d4db6047671daf1f6fb35aa8fe884f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Fri, 12 Apr 2019 10:17:42 +0200 Subject: [PATCH] Comparable --- README.md | 4 ++-- index.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2f5cebc..f56b87b 100644 --- a/README.md +++ b/README.md @@ -876,7 +876,7 @@ class MyComparable: def __eq__(self, other): if isinstance(other, type(self)): return self.a == other.a - return False + return NotImplemented ``` ### Hashable @@ -894,7 +894,7 @@ class MyHashable: def __eq__(self, other): if isinstance(other, type(self)): return self.a == other.a - return False + return NotImplemented def __hash__(self): return hash(self.a) ``` diff --git a/index.html b/index.html index d3af7c9..472f974 100644 --- a/index.html +++ b/index.html @@ -782,7 +782,7 @@ creature = Creature() def __eq__(self, other): if isinstance(other, type(self)): return self.a == other.a - return False + return NotImplemented

Hashable