Skip to content

Commit 9a76b13

Browse files
authored
Add _typeshed.Incomplete (#7535)
Closes: #5613
1 parent b63c963 commit 9a76b13

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

stdlib/_typeshed/__init__.pyi

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import mmap
88
import sys
99
from os import PathLike
1010
from typing import AbstractSet, Any, Awaitable, Container, Generic, Iterable, Protocol, TypeVar
11-
from typing_extensions import Final, Literal, final
11+
from typing_extensions import Final, Literal, TypeAlias, final
1212

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

26+
# For partially known annotations. Usually, fields where type annotations
27+
# haven't been added are left unannotated, but in some situations this
28+
# isn't possible or a type is already partially known. In cases like these,
29+
# use Incomplete instead of Any as a marker. For example, use
30+
# "Incomplete | None" instead of "Any | None".
31+
Incomplete: TypeAlias = Any
32+
2633
# stable
2734
class IdentityFunction(Protocol):
2835
def __call__(self, __x: _T) -> _T: ...

0 commit comments

Comments
 (0)