We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0471c99 commit 266993dCopy full SHA for 266993d
test-data/unit/lib-stub/_weakref.pyi
@@ -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
11
+def proxy(object: _T, callback: Callable[[_T], Any] | None = None, /) -> Any: ...
0 commit comments