Specialize plain slice type hints (#13007)

This commit is contained in:
Randolf Scholz
2026-01-23 10:35:39 +01:00
committed by GitHub
parent 2ff920f291
commit 5c49b1fe49
15 changed files with 69 additions and 69 deletions
+3 -3
View File
@@ -2,7 +2,7 @@ import sys
from _typeshed import SupportsWrite, Unused
from collections.abc import Generator, Iterable, Iterator, Mapping
from types import FrameType, TracebackType
from typing import Any, ClassVar, Literal, overload
from typing import Any, ClassVar, Literal, SupportsIndex, overload
from typing_extensions import Self, TypeAlias, deprecated
__all__ = [
@@ -305,9 +305,9 @@ class FrameSummary:
@overload
def __getitem__(self, pos: Literal[3]) -> str | None: ...
@overload
def __getitem__(self, pos: int) -> Any: ...
def __getitem__(self, pos: SupportsIndex) -> Any: ...
@overload
def __getitem__(self, pos: slice) -> tuple[Any, ...]: ...
def __getitem__(self, pos: slice[SupportsIndex | None]) -> tuple[Any, ...]: ...
def __iter__(self) -> Iterator[Any]: ...
def __eq__(self, other: object) -> bool: ...
def __len__(self) -> Literal[4]: ...