Thanks to visit codestin.com Credit goes to github.com
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.
_typeshed.Self
1 parent 54447f6 commit 262d73cCopy full SHA for 262d73c
1 file changed
stdlib/_typeshed/__init__.pyi
@@ -19,8 +19,10 @@ _T = TypeVar("_T")
19
_T_co = TypeVar("_T_co", covariant=True)
20
_T_contra = TypeVar("_T_contra", contravariant=True)
21
22
-# Use for "self" annotations:
23
-# def __enter__(self: Self) -> Self: ...
+# Alternative to `typing_extensions.Self`, exclusively for use with `__new__`
+# in metaclasses:
24
+# def __new__(cls: type[Self], ...) -> Self: ...
25
+# In other cases, use `typing_extensions.Self`.
26
Self = TypeVar("Self") # noqa: Y001
27
28
# covariant version of typing.AnyStr, useful for protocols
0 commit comments