pint
pint copied to clipboard
Type error when creating Quantity in 0.24.4
After upgrading to 0.24.4, I get a type error for this example:
Code:
from pint import UnitRegistry
ureg = UnitRegistry()
distance = 24.0 * ureg.meter
Error:
example.py:5:1 - error: Type of "distance" is partially unknown
Type of "distance" is "Unit | Unknown | PlainQuantity[Any] | _NotImplementedType" (reportUnknownVariableType)
I am using pyright 1.1.388 on strict mode.
When using 0.24.3, pyright was able to infer the type of distance as _NotImplementedType | Quantity and did not raise any errors.
I think this is because __mul__ is not typed.
Duplicate of #1947