what is the special method for exponent? For example:
class Foo:
def __init__(self,data):
self.data = data
def __pow__(self, power):
return self.data ** power
if __name__ == '__main__':
f=Foo(2)
print(f**3)
yields 8 correctly, but when I run 3**f it says: TypeError: unsupported operand type(s) for ** or pow(): 'int' and 'Foo'