diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index f70e3d6db..9530b5ca7 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -589,7 +589,10 @@ class str(Sequence[str]): def __contains__(self, key: str, /) -> bool: ... # type: ignore[override] def __eq__(self, value: object, /) -> bool: ... def __ge__(self, value: str, /) -> bool: ... - def __getitem__(self, key: SupportsIndex | slice, /) -> str: ... + @overload + def __getitem__(self: LiteralString, key: SupportsIndex | slice, /) -> LiteralString: ... + @overload + def __getitem__(self, key: SupportsIndex | slice, /) -> str: ... # type: ignore[misc] def __gt__(self, value: str, /) -> bool: ... def __hash__(self) -> int: ... @overload