declaring multimethods [Was: Re: PEP 318]

Skip Montanaro skip at
Wed Mar 24 22:44:25 CET 2004

    Joe> I think my preferred way to do this would be just

    Joe>     class MatrixBase:
    Joe>         pass

    Joe>     class Matrix(MatrixBase):
    Joe>         def __mul__(self, other) [multimethod(MatrixBase, MatrixBase)]:
    Joe>             ...
    Joe>             return result

Good point.


More information about the Python-list mailing list