Are you reporting a bug, or opening a feature request?
A bug
Please insert below the code you are checking with mypy
test.py:
# type: ignoredeftest1():
return1print(test1())
What is the actual output?
with mypy test.py --strict:
Success: no issues found in 1 source file
with mypy test.py --strict -2:
test.py:1: error: unused 'type: ignore' comment
test.py:3: error: Function is missing a return type annotation
test.py:6: error: Call to untyped function "test1" in typed context
Found 3 errors in 1 file (checked 1 source file)
What is the output you expect?
both mypy test.py --strict and mypy test.py --strict -2:
Success: no issues found in 1 source file
What are the versions of mypy and Python you are using?
mypy: 0.740
python: 3.7.4
Do you see the same issue after installing mypy from Git master?
Activity
brandtbucher commented on Oct 24, 2019
I see the issue here. I'll have a patch up soon.
Nice catch @isac322!
Enable whole-file # type: ignore comments in Python 2.7. (#7789)