Skip to content

Instantly share code, notes, and snippets.

@shibli049
Last active January 23, 2018 05:25
Show Gist options
  • Save shibli049/8f94f452ca6d60aaee97b3bdc1462188 to your computer and use it in GitHub Desktop.
Save shibli049/8f94f452ca6d60aaee97b3bdc1462188 to your computer and use it in GitHub Desktop.
class MagicalObject(object):
def __init__(self, num):
self.num = num
def __eq__(self, other):
return type(self.num) == type(other)
a = MagicalObject(0)
print(a == 1 and a == 2 and a == 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment