Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9a76b13

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

File tree

Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed

‎stdlib/_typeshed/__init__.pyi

Copy file name to clipboardExpand all lines: stdlib/_typeshed/__init__.pyi
+8-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.