Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion stdlib/_typeshed/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import mmap
import sys
from os import PathLike
from typing import AbstractSet, Any, Awaitable, Container, Generic, Iterable, Protocol, TypeVar
from typing_extensions import Final, Literal, final
from typing_extensions import Final, Literal, TypeAlias, final

_KT = TypeVar("_KT")
_KT_co = TypeVar("_KT_co", covariant=True)
Expand All @@ -23,6 +23,13 @@ _T_contra = TypeVar("_T_contra", contravariant=True)
# def __enter__(self: Self) -> Self: ...
Self = TypeVar("Self") # noqa Y001

# For partially known annotations. Usually, fields where type annotations
# haven't been added are left unannotated, but in some situations this
# isn't possible or a type is already partially known. In cases like these,
# use Incomplete instead of Any as a marker. For example, use
# "Incomplete | None" instead of "Any | None".
Incomplete: TypeAlias = Any

# stable
class IdentityFunction(Protocol):
def __call__(self, __x: _T) -> _T: ...
Expand Down