| 1 | initial version |
by defining a method def __mul__(self, other): in your class called quater.
| 2 | No.2 Revision |
by defining a method def __mul__(self, other): in your class called quater.. Something like this:
def __mul__(self, other):
if isinstance(other, Integer):
...
return something
elif isinstance(other, quater):
...
return something else
else:
raise TypeError('multiplication with other(={}) not defined'.format(other))
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.