-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugmypy got something wrongmypy got something wrongpriority-1-normaltopic-type-ignore# type: ignore comments# type: ignore commentstopic-usability
Description
Consider the following mixed Python 2 and 3 stub:
import sys
if sys.version_info < (3,):
class X:
def foo(self) -> int: ...
class Y(X):
def foo(self) -> str: ... # type: ignoreUsing mypy 0.641 and Python 3.6.7 when running this with mypy --warn-unused-ignores mypy wll complain:
foo.pyi:7: note: unused 'type: ignore' comment
As expected it will not complain when running in --py2 mode. I believe mypy should not complain about ignores in branches that are not checked.
See also #2961, which is more generic.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongpriority-1-normaltopic-type-ignore# type: ignore comments# type: ignore commentstopic-usability