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
If you have a list or dict with numpy functions, it takes too-long to typecheck.
We have a lot of code that uses numpy and I found that one of our 300-line modules was taking 2 hours to typecheck. Using --line-checking-stats I noticed that a single line had stats in the billions (1000x more than other lines). It was something like this:
Bug Report
If you have a list or dict with numpy functions, it takes too-long to typecheck.
We have a lot of code that uses numpy and I found that one of our 300-line modules was taking 2 hours to typecheck. Using
--line-checking-stats
I noticed that a single line had stats in the billions (1000x more than other lines). It was something like this:To Reproduce
Expected Behavior
This to type check quickly.
Actual Behavior
This takes 4 seconds.
Workaround
If you add an explicit type then it typechecks quickly:
Your Environment
pip install --force mypy --no-binary :all
)mypy.ini
(and other config files): noneNote: I also tried mypy 0.982 and it was about 10x slower. The performance improvements (e.g. #13821) definitely helped!
Profile
I graphed the relation between the size of the list and the time to typecheck:

and I ran it through py-spy:
The text was updated successfully, but these errors were encountered: