-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codetopic-overloads
Description
This fragment generates a false positive, starting from #15913:
from typing import overload, Any
class C:
@overload
def f(self, e: str, **kwargs) -> str: ...
@overload
# error: Overloaded function signature 2 will never be matched: signature 1's
# parameter type(s) are the same or broader
def f(self, *args, **kwargs) -> Any: ...
def f(self, *args, **kwargs):
pass
The signature of item 2 is wider than item 1 due to accepting an arbitrary number of positional arguments and with arbitrary types, so this is a false positive.
cc @ilevkivskyi
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codetopic-overloads