Closed maiksprenger closed 11 years ago
Why would you ever multiplicate a price by anything other than a scalar (int
or decimal.Decimal
)?
Don't really know what to say... I guess it happens for the same reasons humans make the other mistakes that prices protects against.
I mean I'd rather forbid multiplying price by price altogether, not check for matching currencies.
Indeed, sounds like a good place for an exception.
I'd be happy with either solution.
I'm trying to fix it but can't manage to multiplicate two Price
objects. Can you provide a test case?
Hello Patryk,
like I said, I just looked at the source code and saw mul being implemented. So I'm afraid I can't provide a test case.
I'm looking through your source code because I'm quite interested in the module. Good work!
I noticed that
__mul__
is implemented without checking for currency though. If I'm not mistaken, that's a bug.