Add _typeshed.Incomplete (#7535)

Closes: #5613
This commit is contained in:
Sebastian Rittau
2022-03-25 10:18:09 +01:00
committed by GitHub
parent b63c963077
commit 9a76b13127

View File

@@ -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)
@@ -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: ...