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
{{ message }}
Repository navigation
Type checking is not working for parameters entered inline with a function #412
Describe the bug
Not sure if this is the correct project to report this issue; it may look like a mypy issue, but I could not reproduce it with any example that was not from pandas-stubs.
Mypy is not complaining about a wrong pd.Series when passing directly in a function.
To Reproduce
Example not displaying error:
from __future__ importannotationsimportpandasaspddefsome_function(param: pd.Series[str]) ->pd.Series[float]:
returnparam.astype(float)
some_function(param=pd.Series([1.0, 1.0, 1.0], dtype=float)
mypy doesn't complain
>>>mypy test.py
Success: no issues found in 1 source file
But, if this value is kept in a variable, the error is shown.
Activity
[-]Issue not [/-][+]Type checking is not working for parameters entered inline with a function[/+]Dr-Irv commentedon Nov 4, 2022
It's a
mypybug. I just reported it here: python/mypy#14009Dr-Irv commentedon Nov 20, 2022
Still a mypy bug in version 0.990
Dr-Irv commentedon Aug 15, 2023
Based on discussion in python/mypy#14009 (see python/mypy#14009 (comment) ), this is a subtle feature of how type checkers work.
So we can't fix this because we need to support
Serieswith unspecified types.