-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
stubs: false positiveType checkers report false errorsType checkers report false errors
Description
Example:
from dataclasses import dataclass, asdict
@dataclass
class D:
x: int
asdict(D(1), dict_factory=dict) # Argument "dict_factory" to "asdict" has incompatible type "Type[Dict[Any, Any]]"; expected "Callable[[List[Tuple[str, Any]]], Dict[_KT, _VT]]"
But, since dict
is used a default implementation, it should be valid.
Source: https://github.com/python/cpython/blob/325ae93b6b7113cd4a4c2ce441615ae7def779e2/Lib/dataclasses.py#L1254
Found in python/mypy#13367
Metadata
Metadata
Assignees
Labels
stubs: false positiveType checkers report false errorsType checkers report false errors