Skip to content

Instantly share code, notes, and snippets.

@greylurk
Created October 8, 2015 13:57
Show Gist options
  • Save greylurk/9e66ef393e0be161e08f to your computer and use it in GitHub Desktop.
Save greylurk/9e66ef393e0be161e08f to your computer and use it in GitHub Desktop.
class StupidMath():
def __init__(self, number):
self.number = number
def __add__(self, other):
return repr(self.number - other.number) + repr(self.number+other.number)
def __repr__(self):
return str(self.number)
print "{} + {} = {}".format(StupidMath(10), StupidMath(3), StupidMath(10) + StupidMath(3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment