4 ms·
On the contrary, wouldn't OP's solution be an example of more generalized implementation of multiplication? I can see that it is similar to (X * 2) where X defi
by ajitk 14y ago
On the contrary, wouldn't OP's solution be an example of more generalized implementation of multiplication? I can see that it is similar to (X * 2) where X defines behavior of __mul__.
Yes, there is chance that arbitrary objects can provide different semantics for __mul__. It would be true for any language.