Using Python Pint, I'm getting a strange result when multiplying units of the same quantity. You would expect them to merge, but they don't. For example:
from pint import UnitRegistry
units = UnitRegistry()
Then:
(3 * units.m) * ( 5 * units.m)
... results in:
<Quantity(15, 'meter ** 2')>
... which is correct. But if I convert one of the factors to millimeters, like so:
(3 * units.m) * ( 5000 * units.mm)
... it gives a nonsense answer:
<Quantity(15000, 'meter * millimeter')>
The same thing happens with division, and with other dimensions, like mass, time, etc.
However, addition does work:
(3 * units.m) + ( 5000 * units.mm)
<Quantity(8.0, 'meter')>
Anyone know anything about this?