Skip to content
Closed
Show file tree
Hide file tree
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
8 changes: 6 additions & 2 deletions stdlib/_typeshed/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,12 @@ class SupportsIter(Protocol[_T_co]):
class SupportsAiter(Protocol[_T_co]):
def __aiter__(self) -> _T_co: ...

class SupportsLenAndGetItem(Protocol[_T_co]):
def __len__(self) -> int: ...
class SupportsIntGetItem(Protocol[_T_co]):
def __getitem__(self, __k: int) -> _T_co: ...

class SupportsLenAndGetItem(SupportsIntGetItem[_T_co]):
def __len__(self) -> int: ...

class SupportsTrunc(Protocol):
def __trunc__(self) -> int: ...

Expand Down Expand Up @@ -276,3 +278,5 @@ ProfileFunction: TypeAlias = Callable[[FrameType, str, Any], object]
# Objects suitable to be passed to sys.settrace, threading.settrace, and similar
# TODO: Ideally this would be a recursive type alias
TraceFunction: TypeAlias = Callable[[FrameType, str, Any], Callable[[FrameType, str, Any], Any] | None]

IterableOrSupportsIntGetItem: TypeAlias = Iterable[_T] | SupportsIntGetItem[_T]
Loading