Ask Your Question

Revision history [back]

by defining a method def __mul__(self, other): in your class called quater.

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))