-
Notifications
You must be signed in to change notification settings - Fork 42
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
PintType is not mypy-friendly #213
Comments
Try adding I imagine there will be more mypy issues... Would be good to get that working nicely |
Thanks for that suggestion. Unfortunately
But editing |
As an amendment to the above, I did figure out that running |
I'll leave this issue open as I doubt that's all the mypy issues that will come up... If we could get mypy running in the CI that would help |
Here is some sample code that
mypy
cannot handle:mypy
throws the following error on the above:The particular problem is that the
PintType
that were are looking at here (pint[Gt CO2e]
) is forcibly given aunits
attribute in this part ofconstruct_from_string
:But
mypy
sees nounits
in the class declaration. Is there a way to preview tomypy
that aunits
property will come? Or do we just have to turn off typing when usingunits
from a PintType?The text was updated successfully, but these errors were encountered: