Created
February 8, 2013 22:58
-
-
Save onyxfish/4742653 to your computer and use it in GitHub Desktop.
Operators are an Illusion; A 2nd Koan for Katie
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
#!/usr/bin/env python | |
class SevenObject(object): | |
def __add__(self, other): | |
return 7 + other | |
def __sub__(self, other): | |
return 7 - other | |
seven = SevenObject() | |
five = 5 | |
print 'seven - five = %i' % (seven - five) | |
print 'seven + five = %i' % (seven + five) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment