Skip to content

Commit 588623f

Browse files
hauntsaninjaJelleZijlstra
authored andcommitted
Remove use of LiteralString in builtins (#13743)
1 parent c0fce06 commit 588623f

File tree

1 file changed

+0
-93
lines changed

1 file changed

+0
-93
lines changed

mypy/typeshed/stdlib/builtins.pyi

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ from typing import ( # noqa: Y022
5757
from typing_extensions import (
5858
Concatenate,
5959
Literal,
60-
LiteralString,
6160
ParamSpec,
6261
Self,
6362
SupportsIndex,
@@ -445,38 +444,20 @@ class str(Sequence[str]):
445444
def __new__(cls, object: object = ...) -> Self: ...
446445
@overload
447446
def __new__(cls, object: ReadableBuffer, encoding: str = ..., errors: str = ...) -> Self: ...
448-
@overload
449-
def capitalize(self: LiteralString) -> LiteralString: ...
450-
@overload
451447
def capitalize(self) -> str: ... # type: ignore[misc]
452-
@overload
453-
def casefold(self: LiteralString) -> LiteralString: ...
454-
@overload
455448
def casefold(self) -> str: ... # type: ignore[misc]
456-
@overload
457-
def center(self: LiteralString, __width: SupportsIndex, __fillchar: LiteralString = " ") -> LiteralString: ...
458-
@overload
459449
def center(self, __width: SupportsIndex, __fillchar: str = " ") -> str: ... # type: ignore[misc]
460450
def count(self, x: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
461451
def encode(self, encoding: str = "utf-8", errors: str = "strict") -> bytes: ...
462452
def endswith(
463453
self, __suffix: str | tuple[str, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
464454
) -> bool: ...
465455
if sys.version_info >= (3, 8):
466-
@overload
467-
def expandtabs(self: LiteralString, tabsize: SupportsIndex = 8) -> LiteralString: ...
468-
@overload
469456
def expandtabs(self, tabsize: SupportsIndex = 8) -> str: ... # type: ignore[misc]
470457
else:
471-
@overload
472-
def expandtabs(self: LiteralString, tabsize: int = 8) -> LiteralString: ...
473-
@overload
474458
def expandtabs(self, tabsize: int = 8) -> str: ... # type: ignore[misc]
475459

476460
def find(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
477-
@overload
478-
def format(self: LiteralString, *args: LiteralString, **kwargs: LiteralString) -> LiteralString: ...
479-
@overload
480461
def format(self, *args: object, **kwargs: object) -> str: ...
481462
def format_map(self, map: _FormatMapMapping) -> str: ...
482463
def index(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
@@ -492,91 +473,32 @@ class str(Sequence[str]):
492473
def isspace(self) -> bool: ...
493474
def istitle(self) -> bool: ...
494475
def isupper(self) -> bool: ...
495-
@overload
496-
def join(self: LiteralString, __iterable: Iterable[LiteralString]) -> LiteralString: ...
497-
@overload
498476
def join(self, __iterable: Iterable[str]) -> str: ... # type: ignore[misc]
499-
@overload
500-
def ljust(self: LiteralString, __width: SupportsIndex, __fillchar: LiteralString = " ") -> LiteralString: ...
501-
@overload
502477
def ljust(self, __width: SupportsIndex, __fillchar: str = " ") -> str: ... # type: ignore[misc]
503-
@overload
504-
def lower(self: LiteralString) -> LiteralString: ...
505-
@overload
506478
def lower(self) -> str: ... # type: ignore[misc]
507-
@overload
508-
def lstrip(self: LiteralString, __chars: LiteralString | None = None) -> LiteralString: ...
509-
@overload
510479
def lstrip(self, __chars: str | None = None) -> str: ... # type: ignore[misc]
511-
@overload
512-
def partition(self: LiteralString, __sep: LiteralString) -> tuple[LiteralString, LiteralString, LiteralString]: ...
513-
@overload
514480
def partition(self, __sep: str) -> tuple[str, str, str]: ... # type: ignore[misc]
515-
@overload
516-
def replace(
517-
self: LiteralString, __old: LiteralString, __new: LiteralString, __count: SupportsIndex = -1
518-
) -> LiteralString: ...
519-
@overload
520481
def replace(self, __old: str, __new: str, __count: SupportsIndex = -1) -> str: ... # type: ignore[misc]
521482
if sys.version_info >= (3, 9):
522-
@overload
523-
def removeprefix(self: LiteralString, __prefix: LiteralString) -> LiteralString: ...
524-
@overload
525483
def removeprefix(self, __prefix: str) -> str: ... # type: ignore[misc]
526-
@overload
527-
def removesuffix(self: LiteralString, __suffix: LiteralString) -> LiteralString: ...
528-
@overload
529484
def removesuffix(self, __suffix: str) -> str: ... # type: ignore[misc]
530485

531486
def rfind(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
532487
def rindex(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
533-
@overload
534-
def rjust(self: LiteralString, __width: SupportsIndex, __fillchar: LiteralString = " ") -> LiteralString: ...
535-
@overload
536488
def rjust(self, __width: SupportsIndex, __fillchar: str = " ") -> str: ... # type: ignore[misc]
537-
@overload
538-
def rpartition(self: LiteralString, __sep: LiteralString) -> tuple[LiteralString, LiteralString, LiteralString]: ...
539-
@overload
540489
def rpartition(self, __sep: str) -> tuple[str, str, str]: ... # type: ignore[misc]
541-
@overload
542-
def rsplit(self: LiteralString, sep: LiteralString | None = None, maxsplit: SupportsIndex = -1) -> list[LiteralString]: ...
543-
@overload
544490
def rsplit(self, sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[str]: ... # type: ignore[misc]
545-
@overload
546-
def rstrip(self: LiteralString, __chars: LiteralString | None = None) -> LiteralString: ...
547-
@overload
548491
def rstrip(self, __chars: str | None = None) -> str: ... # type: ignore[misc]
549-
@overload
550-
def split(self: LiteralString, sep: LiteralString | None = None, maxsplit: SupportsIndex = -1) -> list[LiteralString]: ...
551-
@overload
552492
def split(self, sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[str]: ... # type: ignore[misc]
553-
@overload
554-
def splitlines(self: LiteralString, keepends: bool = False) -> list[LiteralString]: ...
555-
@overload
556493
def splitlines(self, keepends: bool = False) -> list[str]: ... # type: ignore[misc]
557494
def startswith(
558495
self, __prefix: str | tuple[str, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
559496
) -> bool: ...
560-
@overload
561-
def strip(self: LiteralString, __chars: LiteralString | None = None) -> LiteralString: ...
562-
@overload
563497
def strip(self, __chars: str | None = None) -> str: ... # type: ignore[misc]
564-
@overload
565-
def swapcase(self: LiteralString) -> LiteralString: ...
566-
@overload
567498
def swapcase(self) -> str: ... # type: ignore[misc]
568-
@overload
569-
def title(self: LiteralString) -> LiteralString: ...
570-
@overload
571499
def title(self) -> str: ... # type: ignore[misc]
572500
def translate(self, __table: _TranslateTable) -> str: ...
573-
@overload
574-
def upper(self: LiteralString) -> LiteralString: ...
575-
@overload
576501
def upper(self) -> str: ... # type: ignore[misc]
577-
@overload
578-
def zfill(self: LiteralString, __width: SupportsIndex) -> LiteralString: ...
579-
@overload
580502
def zfill(self, __width: SupportsIndex) -> str: ... # type: ignore[misc]
581503
@staticmethod
582504
@overload
@@ -587,9 +509,6 @@ class str(Sequence[str]):
587509
@staticmethod
588510
@overload
589511
def maketrans(__x: str, __y: str, __z: str) -> dict[int, int | None]: ...
590-
@overload
591-
def __add__(self: LiteralString, __value: LiteralString) -> LiteralString: ...
592-
@overload
593512
def __add__(self, __value: str) -> str: ... # type: ignore[misc]
594513
# Incompatible with Sequence.__contains__
595514
def __contains__(self, __key: str) -> bool: ... # type: ignore[override]
@@ -598,25 +517,13 @@ class str(Sequence[str]):
598517
def __getitem__(self, __key: SupportsIndex | slice) -> str: ...
599518
def __gt__(self, __value: str) -> bool: ...
600519
def __hash__(self) -> int: ...
601-
@overload
602-
def __iter__(self: LiteralString) -> Iterator[LiteralString]: ...
603-
@overload
604520
def __iter__(self) -> Iterator[str]: ... # type: ignore[misc]
605521
def __le__(self, __value: str) -> bool: ...
606522
def __len__(self) -> int: ...
607523
def __lt__(self, __value: str) -> bool: ...
608-
@overload
609-
def __mod__(self: LiteralString, __value: LiteralString | tuple[LiteralString, ...]) -> LiteralString: ...
610-
@overload
611524
def __mod__(self, __value: Any) -> str: ...
612-
@overload
613-
def __mul__(self: LiteralString, __value: SupportsIndex) -> LiteralString: ...
614-
@overload
615525
def __mul__(self, __value: SupportsIndex) -> str: ... # type: ignore[misc]
616526
def __ne__(self, __value: object) -> bool: ...
617-
@overload
618-
def __rmul__(self: LiteralString, __value: SupportsIndex) -> LiteralString: ...
619-
@overload
620527
def __rmul__(self, __value: SupportsIndex) -> str: ... # type: ignore[misc]
621528
def __getnewargs__(self) -> tuple[str]: ...
622529

0 commit comments

Comments
 (0)