Skip to content

Commit 6c01c6a

Browse files
authored
Make ProxyType and CallableProxyType Generic (#5166)
1 parent 7d2427b commit 6c01c6a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/_weakref.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ if sys.version_info >= (3, 9):
77
_C = TypeVar("_C", bound=Callable[..., Any])
88
_T = TypeVar("_T")
99

10-
class CallableProxyType(object): # "weakcallableproxy"
10+
class CallableProxyType(Generic[_C]): # "weakcallableproxy"
1111
def __getattr__(self, attr: str) -> Any: ...
1212

13-
class ProxyType(object): # "weakproxy"
13+
class ProxyType(Generic[_T]): # "weakproxy"
1414
def __getattr__(self, attr: str) -> Any: ...
1515

1616
class ReferenceType(Generic[_T]):
@@ -27,7 +27,7 @@ ref = ReferenceType
2727
def getweakrefcount(__object: Any) -> int: ...
2828
def getweakrefs(object: Any) -> List[Any]: ...
2929
@overload
30-
def proxy(object: _C, callback: Optional[Callable[[_C], Any]] = ...) -> CallableProxyType: ...
30+
def proxy(object: _C, callback: Optional[Callable[[_C], Any]] = ...) -> CallableProxyType[_C]: ...
3131

3232
# Return CallableProxyType if object is callable, ProxyType otherwise
3333
@overload

0 commit comments

Comments
 (0)