autoprotocol/autoprotocol-python

Math on Unit quirk

bmiles opened this issue · 0 comments

Just making a note of some behaviour with Unit that caught me out.

In [24]: ben = Unit(5, "microliter")

In [25]: ben * 10
Out[25]: Unit(50.0, microliter)

In [26]: 10 * ben
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-26-91865e2cdf8c> in <module>()
----> 1 10 * ben

TypeError: unsupported operand type(s) for *: 'int' and 'Unit'