Closed as not planned
Closed as not planned
Description
Bug Report
The following example (reduced from psycopg 3) seems to be a false positive:
To Reproduce
from typing import Any, Callable, Generic, overload, Optional, TypeVar, Tuple, Union
Row = TypeVar("Row")
class Connection(Generic[Row]):
@overload
def connect(
self, *, row_factory: Callable[[], Row], **kwargs: Union[None, int, str]
) -> "Connection[Row]":
...
@overload
def connect(
self, **kwargs: Union[None, int, str],
) -> "Connection[Tuple[Any, ...]]":
...
def connect(
self, *, row_factory: Optional[Callable[[], Row]] = None, **kwargs: Any,
) -> "Connection[Any]":
raise NotImplementedError
The file is flagged with the error:
bug_mypy.py:18: error: Overloaded function implementation does not accept all possible arguments of signature 2 [misc]
Your Environment
- Mypy version used: 0.910
- Python version used: 3.8
- Operating system and version: Linux