Skip to content

Commit 55f1f66

Browse files
committed
weakref stubs
1 parent 266993d commit 55f1f66

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
1+
from _weakref import proxy
12
from collections.abc import Callable
2-
from typing import Any, Generic, TypeVar
3+
from typing import Any, ClassVar, Generic, TypeVar, final
34
from typing_extensions import Self
45

6+
_C = TypeVar("_C", bound=Callable[..., Any])
57
_T = TypeVar("_T")
68

79
class ReferenceType(Generic[_T]): # "weakref"
810
__callback__: Callable[[Self], Any]
911
def __new__(cls, o: _T, callback: Callable[[Self], Any] | None = ..., /) -> Self: ...
1012

1113
ref = ReferenceType
14+
15+
@final
16+
class CallableProxyType(Generic[_C]): # "weakcallableproxy"
17+
def __eq__(self, value: object, /) -> bool: ...
18+
def __getattr__(self, attr: str) -> Any: ...
19+
__call__: _C
20+
__hash__: ClassVar[None] # type: ignore[assignment]
21+
22+
__all__ = ["proxy"]

0 commit comments

Comments
 (0)