Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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