mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 08:47:39 +08:00
Update description of _typeshed.Self (#11233)
This commit is contained in:
@@ -19,8 +19,10 @@ _T = TypeVar("_T")
|
||||
_T_co = TypeVar("_T_co", covariant=True)
|
||||
_T_contra = TypeVar("_T_contra", contravariant=True)
|
||||
|
||||
# Use for "self" annotations:
|
||||
# def __enter__(self: Self) -> Self: ...
|
||||
# Alternative to `typing_extensions.Self`, exclusively for use with `__new__`
|
||||
# in metaclasses:
|
||||
# def __new__(cls: type[Self], ...) -> Self: ...
|
||||
# In other cases, use `typing_extensions.Self`.
|
||||
Self = TypeVar("Self") # noqa: Y001
|
||||
|
||||
# covariant version of typing.AnyStr, useful for protocols
|
||||
|
||||
Reference in New Issue
Block a user