Skip to content

Instantly share code, notes, and snippets.

@joelburton
Created April 15, 2016 23:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joelburton/83936127a85dc8685af757cbbd1be846 to your computer and use it in GitHub Desktop.
Save joelburton/83936127a85dc8685af757cbbd1be846 to your computer and use it in GitHub Desktop.
__version__ = "1.0"
class Cat(object):
def __init__(self):
print "making cat"
print "see?", type(self)
self.name = "fluffy"
def __add__(self, other):
if not type(other) == Cat:
raise "Go Away"
kitten = Kitten()
kitten.name = self.name + "-and-" + other.name
return kitten
def __eq__(self, other):
return self.name == other.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment