Skip to content

Instantly share code, notes, and snippets.

@shibli049
Created January 23, 2018 05:29
Show Gist options
  • Save shibli049/0d92b84b5cdc0d9a556879445bd30387 to your computer and use it in GitHub Desktop.
Save shibli049/0d92b84b5cdc0d9a556879445bd30387 to your computer and use it in GitHub Desktop.
class MagicalObject(object):
def __init__(self, num):
self.num = num
def __eq__(self, other):
self.num += 1
return self.num == 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