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

mypy error: ureg.m annotation is expected to be Quantity instead of Unit #1946

Closed
Luna137 opened this issue Mar 4, 2024 · 0 comments · Fixed by #2045 · May be fixed by #1948
Closed

mypy error: ureg.m annotation is expected to be Quantity instead of Unit #1946

Luna137 opened this issue Mar 4, 2024 · 0 comments · Fixed by #2045 · May be fixed by #1948
Labels

Comments

@Luna137
Copy link

Luna137 commented Mar 4, 2024

With the newest version of pint, running mypy on the following script

import pint

ureg = pint.UnitRegistry()
unit_of_length: pint.Unit = ureg.m

returns the following error:

Incompatible types in assignment (expression has type "Quantity", variable has type "Unit")  [assignment]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants