Created
April 15, 2016 23:37
-
-
Save joelburton/83936127a85dc8685af757cbbd1be846 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__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