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
% dmypy restart
Daemon stopped
Daemon started
% dmypy run lib/testlib.py
lib/testlib.py:46: error: Unexpected attribute "xxxx" for model "Xxxx"
lib/testlib.py:142: error: The return type of a generator function should be "Generator" or one of its supertypes
Found 2 errors in 1 file (checked 945 source files)
% dmypy run lib/testlib.py
lib/testlib.py: error: The return type of a generator function should be "Generator" or one of its supertypes
lib/testlib.py:46: error: Unexpected attribute "xxxx" for model "Xxxx"
Found 2 errors in 1 file (checked 1 source file)
Note in the 2nd invocation lib/testlib.py: error: The return type of a generator function no longer has a line number.
To Reproduce
I tried reducing this to a smaller example, but failed to reproduce it that way. :(
Your Environment
Mypy version used: 0.942
Mypy command-line flags: (none)
Mypy configuration options from mypy.ini (and other config files): I can reproduce this when I delete mypy config of my project
Python version used: 3.10.2
Operating system and version: macOS
The text was updated successfully, but these errors were encountered:
$ dmypy run .
Daemon started
generator_test.py:1: error: The return type of a generator function should be "Generator" or one of its supertypes [misc]
$ dmypy run .
generator_test.py: error: The return type of a generator function should be "Generator" or one of its supertypes [misc]
This doesn't happen when dmypy recheck is the second run, but as soon as dmypy run is run another time, the line number disappears:
$ dmypy run .
Daemon started
generator_test.py:1: error: The return type of a generator function should be "Generator" or one of its supertypes [misc]
$ dmypy recheck
generator_test.py:1: error: The return type of a generator function should be "Generator" or one of its supertypes [misc]
$ dmypy run .
generator_test.py: error: The return type of a generator function should be "Generator" or one of its supertypes [misc]
If the return type is Generator or Iterator, this issue doesn't occur, even if the type argument isn't right:
$ dmypy run .
Daemon started
generator_test_2.py:4: error: Incompatible types in "yield" (actual type "int", expected type "None") [misc]
$ dmypy run .
generator_test_2.py:4: error: Incompatible types in "yield" (actual type "int", expected type "None") [misc]
Bug Report
Note in the 2nd invocation
lib/testlib.py: error: The return type of a generator function
no longer has a line number.To Reproduce
I tried reducing this to a smaller example, but failed to reproduce it that way. :(
Your Environment
mypy.ini
(and other config files): I can reproduce this when I delete mypy config of my projectThe text was updated successfully, but these errors were encountered: