You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to add typing to some code I use with Quantity input.ouput. Using the u.quantity_input decorator errors with mypy though, complaining that the decorator is untyped.
Expected behavior
No complaint from mypy
Actual behavior
mypy errors with
test.py:3: error: Untyped decorator makes function "speed" untyped
Found 1 error in 1 file (checked 1 source file)
For quantity_input, @nstarman had a nice PR but it became a bit messy; see #10655 and hence that was closed. So far, what has been implemented is the part that one can do Quantity[unit] (#10662)
Yeah. Typing quantity_input wouldn't actually be all that hard. I would welcome a PR. The underlying issues are that we are hesitant to add a lot of typing before an APE.
I will just reiterate from #14134 that quantity_inputs existing use of function annotations as not-type-hints is perfectly legitimate and should remain supported even if it learns how to read valid type hints in addition.
Description
I'm trying to add typing to some code I use with
Quantity
input.ouput. Using theu.quantity_input
decorator errors withmypy
though, complaining that the decorator is untyped.Expected behavior
No complaint from
mypy
Actual behavior
mypy
errors withSteps to Reproduce
mypy --strict test.py
System Details
macOS-12.6.1-arm64-arm-64bit
Python 3.10.8 | packaged by conda-forge | (main, Nov 22 2022, 08:25:29) [Clang 14.0.6 ]
Numpy 1.23.4
pyerfa 2.0.0.1
astropy 5.1.1
Scipy 1.9.3
Matplotlib 3.6.2
mypy 0.982 (compiled: yes)
The text was updated successfully, but these errors were encountered: