Consider this example:
fromtypingimportGeneric, TypeVar, Any, overloadAnyStr=TypeVar("AnyStr", str, bytes)
classPopen(Generic[AnyStr]):
@overloaddefcommunicate(self: Popen[str], buf: str= ...) ->float: ...
@overloaddefcommunicate(self: Popen[bytes], buf: memoryview|bytes= ...) ->range: ...
defcommunicate(self, buf: object=None) ->Any: raiseNotImplementedErrorp=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.
Consider this example:
This currently reveals
float. I think it should either be the unionfloat | rangeorAny. This came up in python/typeshed#9100.