Using pyright in neovim, I see unexpected behavior in type checking:
import tunits as tu
x = (tu.ElectricPotentialArray(np.array([1, 2, 3]) * tu.V), 5 * tu.W)
reveal_type(x) # Type of "x" is "tuple[ElectricPotentialArray, Power]"
y = x[tu.V]
reveal_type(y) # Type of "y" is "ElectricPotentialArray | Power"
The third line should be flagged as a type error. From the fourth line, it looks like tu.V is being treated as an integer. Is it possible that the type annotations for this library have some bug?
Using pyright in neovim, I see unexpected behavior in type checking:
The third line should be flagged as a type error. From the fourth line, it looks like
tu.Vis being treated as an integer. Is it possible that the type annotations for this library have some bug?