Skip to content

Instantly share code, notes, and snippets.

@onyxfish
Created February 8, 2013 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onyxfish/4742653 to your computer and use it in GitHub Desktop.
Save onyxfish/4742653 to your computer and use it in GitHub Desktop.
Operators are an Illusion; A 2nd Koan for Katie
#!/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