Skip to content

Commit 9807215

Browse files
committed
fix(weakref): make proxy return ProxyType[_T] for non-callable _T
Signed-off-by: Pavel Dydyshka <paul.dydyshko@gmail.com>
1 parent b9090e9 commit 9807215

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

stdlib/_weakref.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ def getweakrefs(object: Any, /) -> list[Any]: ...
1010

1111
# Return CallableProxyType if object is callable, ProxyType otherwise
1212
@overload
13-
def proxy(object: _C, callback: Callable[[_C], Any] | None = None, /) -> CallableProxyType[_C]: ...
13+
def proxy(object: _T, callback: Callable[[_T], Any] | None = None, /) -> ProxyType[_T]: ...
1414
@overload
15-
def proxy(object: _T, callback: Callable[[_T], Any] | None = None, /) -> Any: ...
15+
def proxy(object: _C, callback: Callable[[_C], Any] | None = None, /) -> CallableProxyType[_C]: ...

0 commit comments

Comments
 (0)