Open
Description
Consider this example:
from typing import Generic, TypeVar, Any, overload
AnyStr = TypeVar("AnyStr", str, bytes)
class Popen(Generic[AnyStr]):
@overload
def communicate(self: Popen[str], buf: str = ...) -> float: ...
@overload
def communicate(self: Popen[bytes], buf: memoryview | bytes = ...) -> range: ...
def communicate(self, buf: object = None) -> Any: raise NotImplementedError
p = Popen()
reveal_type(p.communicate())
This currently reveals float
. I think it should either be the union float | range
or Any
. This came up in python/typeshed#9100.