Next / Previous / Contents / Shipman's homepage

27.5. FoDim.__mul__()

Here, the right-hand operator must be a constant, and the result is self multiplied by that constant.

fosox.py
# - - -   F o D i m . _ _ m u l _ _

    def __mul__ ( self, other ):
        '''Multiply self by a constant.
        '''
        return FoDim ( self.n * Decimal(other), self.units )