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
Today I tried using dmypy for the first time and noticed a really strange bug: the second run produced different results than the first run!
More specifically (and even stranger) the error message "Final name must be initialized with a value" spreads from a known false positive (#5608) to other cases.
Subsequent spread the error from cases where it is expected to cases where it is not.
$ dmypy startDaemon started
$ dmypy check srcsrc/dmypy_final_bug/__init__.py:10: error: Final name must be initialized with a value [misc]src/dmypy_final_bug/__init__.py:11: error: Final name must be initialized with a value [misc]Found 2 errors in 1 file (checked 1 source file)
$ dmypy check srcsrc/dmypy_final_bug/__init__.py:10: error: Final name must be initialized with a value [misc]src/dmypy_final_bug/__init__.py:11: error: Final name must be initialized with a value [misc]src/dmypy_final_bug/__init__.py:15: error: Final name must be initialized with a value [misc]src/dmypy_final_bug/__init__.py:16: error: Final name must be initialized with a value [misc]Found 4 errors in 1 file (checked 1 source file)
Your Environment
python==3.12.4
mypy==1.11.1
torch==2.4.0
The text was updated successfully, but these errors were encountered:
Today I tried using dmypy for the first time and noticed a really strange bug: the second run produced different results than the first run!
More specifically (and even stranger) the error message "Final name must be initialized with a value" spreads from a known false positive (#5608) to other cases.
To Reproduce
I created a repository with complete repro: https://github.com/randolf-scholz/dmypy_bug
It seems 3 things are relevant:
(I believe this is because the 3.12 wheel of
torch==2.4.0
ships with thepy.typed
marker, but the 3.11 wheel doesn't)torch
must be imported.dataclass
using aFinal
annotation is defined.minimal working example
Expected Behavior
Subsequent runs should yield the same results.
Actual Behavior
Subsequent spread the error from cases where it is expected to cases where it is not.
Your Environment
python==3.12.4
mypy==1.11.1
torch==2.4.0
The text was updated successfully, but these errors were encountered: