Skip to content

Commit 266993d

Browse files
committed
_weakref stubs
1 parent 0471c99 commit 266993d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test-data/unit/lib-stub/_weakref.pyi

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from typing import Any, Callable, TypeVar, overload
2+
from weakref import CallableProxyType
3+
4+
_C = TypeVar("_C", bound=Callable[..., Any])
5+
_T = TypeVar("_T")
6+
7+
# Return CallableProxyType if object is callable, ProxyType otherwise
8+
@overload
9+
def proxy(object: _C, callback: Callable[[_C], Any] | None = None, /) -> CallableProxyType[_C]: ...
10+
@overload
11+
def proxy(object: _T, callback: Callable[[_T], Any] | None = None, /) -> Any: ...

0 commit comments

Comments
 (0)