Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type error when creating Quantity in 0.24.4 #2075

Open
brearleyt opened this issue Nov 8, 2024 · 0 comments
Open

Type error when creating Quantity in 0.24.4 #2075

brearleyt opened this issue Nov 8, 2024 · 0 comments

Comments

@brearleyt
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant