![]() | 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))