From 6c01c6afdcf67aeeb51867e3d7222e28bf4f0fd4 Mon Sep 17 00:00:00 2001 From: hatal175 Date: Thu, 8 Apr 2021 05:52:22 +0300 Subject: [PATCH] Make ProxyType and CallableProxyType Generic (#5166) --- stdlib/_weakref.pyi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stdlib/_weakref.pyi b/stdlib/_weakref.pyi index 339fe7335..115a591ce 100644 --- a/stdlib/_weakref.pyi +++ b/stdlib/_weakref.pyi @@ -7,10 +7,10 @@ if sys.version_info >= (3, 9): _C = TypeVar("_C", bound=Callable[..., Any]) _T = TypeVar("_T") -class CallableProxyType(object): # "weakcallableproxy" +class CallableProxyType(Generic[_C]): # "weakcallableproxy" def __getattr__(self, attr: str) -> Any: ... -class ProxyType(object): # "weakproxy" +class ProxyType(Generic[_T]): # "weakproxy" def __getattr__(self, attr: str) -> Any: ... class ReferenceType(Generic[_T]): @@ -27,7 +27,7 @@ ref = ReferenceType def getweakrefcount(__object: Any) -> int: ... def getweakrefs(object: Any) -> List[Any]: ... @overload -def proxy(object: _C, callback: Optional[Callable[[_C], Any]] = ...) -> CallableProxyType: ... +def proxy(object: _C, callback: Optional[Callable[[_C], Any]] = ...) -> CallableProxyType[_C]: ... # Return CallableProxyType if object is callable, ProxyType otherwise @overload