Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mattjmorrison/863220 to your computer and use it in GitHub Desktop.
Save mattjmorrison/863220 to your computer and use it in GitHub Desktop.
class Var:
def __init__(self, name):
self.name = name
def __repr__(self):
return self.name
def __add__(self, other):
return Var('({0.name}+{1.name})'.format(self, other))
def __sub__(self, other):
return Var('({0.name}-{1.name})'.format(self, other))
def __truediv__(self, other):
return Var('{0.name}/{1}'.format(self, other))
print(wavelet((Var('a'), Var('b'), Var('c'), Var('d'))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment