Skip to content

Commit 2f6b6e6

Browse files
committed
Remove use of LiteralString in builtins (#13743)
1 parent d7f9f06 commit 2f6b6e6

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
@@ -56,7 +56,6 @@ from typing import ( # noqa: Y022
5656
from typing_extensions import (
5757
Concatenate,
5858
Literal,
59-
LiteralString,
6059
ParamSpec,
6160
Self,
6261
SupportsIndex,
@@ -436,38 +435,20 @@ class str(Sequence[str]):
436435
def __new__(cls, object: object = ...) -> Self: ...
437436
@overload
438437
def __new__(cls, object: ReadableBuffer, encoding: str = ..., errors: str = ...) -> Self: ...
439-
@overload
440-
def capitalize(self: LiteralString) -> LiteralString: ...
441-
@overload
442438
def capitalize(self) -> str: ... # type: ignore[misc]
443-
@overload
444-
def casefold(self: LiteralString) -> LiteralString: ...
445-
@overload
446439
def casefold(self) -> str: ... # type: ignore[misc]
447-
@overload
448-
def center(self: LiteralString, __width: SupportsIndex, __fillchar: LiteralString = " ") -> LiteralString: ...
449-
@overload
450440
def center(self, __width: SupportsIndex, __fillchar: str = " ") -> str: ... # type: ignore[misc]
451441
def count(self, x: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
452442
def encode(self, encoding: str = "utf-8", errors: str = "strict") -> bytes: ...
453443
def endswith(
454444
self, __suffix: str | tuple[str, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
455445
) -> bool: ...
456446
if sys.version_info >= (3, 8):
457-
@overload
458-
def expandtabs(self: LiteralString, tabsize: SupportsIndex = 8) -> LiteralString: ...
459-
@overload
460447
def expandtabs(self, tabsize: SupportsIndex = 8) -> str: ... # type: ignore[misc]
461448
else:
462-
@overload
463-
def expandtabs(self: LiteralString, tabsize: int = 8) -> LiteralString: ...
464-
@overload
465449
def expandtabs(self, tabsize: int = 8) -> str: ... # type: ignore[misc]
466450

467451
def find(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
468-
@overload
469-
def format(self: LiteralString, *args: LiteralString, **kwargs: LiteralString) -> LiteralString: ...
470-
@overload
471452
def format(self, *args: object, **kwargs: object) -> str: ...
472453
def format_map(self, map: _FormatMapMapping) -> str: ...
473454
def index(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
@@ -483,91 +464,32 @@ class str(Sequence[str]):
483464
def isspace(self) -> bool: ...
484465
def istitle(self) -> bool: ...
485466
def isupper(self) -> bool: ...
486-
@overload
487-
def join(self: LiteralString, __iterable: Iterable[LiteralString]) -> LiteralString: ...
488-
@overload
489467
def join(self, __iterable: Iterable[str]) -> str: ... # type: ignore[misc]
490-
@overload
491-
def ljust(self: LiteralString, __width: SupportsIndex, __fillchar: LiteralString = " ") -> LiteralString: ...
492-
@overload
493468
def ljust(self, __width: SupportsIndex, __fillchar: str = " ") -> str: ... # type: ignore[misc]
494-
@overload
495-
def lower(self: LiteralString) -> LiteralString: ...
496-
@overload
497469
def lower(self) -> str: ... # type: ignore[misc]
498-
@overload
499-
def lstrip(self: LiteralString, __chars: LiteralString | None = None) -> LiteralString: ...
500-
@overload
501470
def lstrip(self, __chars: str | None = None) -> str: ... # type: ignore[misc]
502-
@overload
503-
def partition(self: LiteralString, __sep: LiteralString) -> tuple[LiteralString, LiteralString, LiteralString]: ...
504-
@overload
505471
def partition(self, __sep: str) -> tuple[str, str, str]: ... # type: ignore[misc]
506-
@overload
507-
def replace(
508-
self: LiteralString, __old: LiteralString, __new: LiteralString, __count: SupportsIndex = -1
509-
) -> LiteralString: ...
510-
@overload
511472
def replace(self, __old: str, __new: str, __count: SupportsIndex = -1) -> str: ... # type: ignore[misc]
512473
if sys.version_info >= (3, 9):
513-
@overload
514-
def removeprefix(self: LiteralString, __prefix: LiteralString) -> LiteralString: ...
515-
@overload
516474
def removeprefix(self, __prefix: str) -> str: ... # type: ignore[misc]
517-
@overload
518-
def removesuffix(self: LiteralString, __suffix: LiteralString) -> LiteralString: ...
519-
@overload
520475
def removesuffix(self, __suffix: str) -> str: ... # type: ignore[misc]
521476

522477
def rfind(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
523478
def rindex(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ...
524-
@overload
525-
def rjust(self: LiteralString, __width: SupportsIndex, __fillchar: LiteralString = " ") -> LiteralString: ...
526-
@overload
527479
def rjust(self, __width: SupportsIndex, __fillchar: str = " ") -> str: ... # type: ignore[misc]
528-
@overload
529-
def rpartition(self: LiteralString, __sep: LiteralString) -> tuple[LiteralString, LiteralString, LiteralString]: ...
530-
@overload
531480
def rpartition(self, __sep: str) -> tuple[str, str, str]: ... # type: ignore[misc]
532-
@overload
533-
def rsplit(self: LiteralString, sep: LiteralString | None = None, maxsplit: SupportsIndex = -1) -> list[LiteralString]: ...
534-
@overload
535481
def rsplit(self, sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[str]: ... # type: ignore[misc]
536-
@overload
537-
def rstrip(self: LiteralString, __chars: LiteralString | None = None) -> LiteralString: ...
538-
@overload
539482
def rstrip(self, __chars: str | None = None) -> str: ... # type: ignore[misc]
540-
@overload
541-
def split(self: LiteralString, sep: LiteralString | None = None, maxsplit: SupportsIndex = -1) -> list[LiteralString]: ...
542-
@overload
543483
def split(self, sep: str | None = None, maxsplit: SupportsIndex = -1) -> list[str]: ... # type: ignore[misc]
544-
@overload
545-
def splitlines(self: LiteralString, keepends: bool = False) -> list[LiteralString]: ...
546-
@overload
547484
def splitlines(self, keepends: bool = False) -> list[str]: ... # type: ignore[misc]
548485
def startswith(
549486
self, __prefix: str | tuple[str, ...], __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...
550487
) -> bool: ...
551-
@overload
552-
def strip(self: LiteralString, __chars: LiteralString | None = None) -> LiteralString: ...
553-
@overload
554488
def strip(self, __chars: str | None = None) -> str: ... # type: ignore[misc]
555-
@overload
556-
def swapcase(self: LiteralString) -> LiteralString: ...
557-
@overload
558489
def swapcase(self) -> str: ... # type: ignore[misc]
559-
@overload
560-
def title(self: LiteralString) -> LiteralString: ...
561-
@overload
562490
def title(self) -> str: ... # type: ignore[misc]
563491
def translate(self, __table: _TranslateTable) -> str: ...
564-
@overload
565-
def upper(self: LiteralString) -> LiteralString: ...
566-
@overload
567492
def upper(self) -> str: ... # type: ignore[misc]
568-
@overload
569-
def zfill(self: LiteralString, __width: SupportsIndex) -> LiteralString: ...
570-
@overload
571493
def zfill(self, __width: SupportsIndex) -> str: ... # type: ignore[misc]
572494
@staticmethod
573495
@overload
@@ -578,9 +500,6 @@ class str(Sequence[str]):
578500
@staticmethod
579501
@overload
580502
def maketrans(__x: str, __y: str, __z: str) -> dict[int, int | None]: ...
581-
@overload
582-
def __add__(self: LiteralString, __value: LiteralString) -> LiteralString: ...
583-
@overload
584503
def __add__(self, __value: str) -> str: ... # type: ignore[misc]
585504
# Incompatible with Sequence.__contains__
586505
def __contains__(self, __key: str) -> bool: ... # type: ignore[override]
@@ -589,25 +508,13 @@ class str(Sequence[str]):
589508
def __getitem__(self, __key: SupportsIndex | slice) -> str: ...
590509
def __gt__(self, __value: str) -> bool: ...
591510
def __hash__(self) -> int: ...
592-
@overload
593-
def __iter__(self: LiteralString) -> Iterator[LiteralString]: ...
594-
@overload
595511
def __iter__(self) -> Iterator[str]: ... # type: ignore[misc]
596512
def __le__(self, __value: str) -> bool: ...
597513
def __len__(self) -> int: ...
598514
def __lt__(self, __value: str) -> bool: ...
599-
@overload
600-
def __mod__(self: LiteralString, __value: LiteralString | tuple[LiteralString, ...]) -> LiteralString: ...
601-
@overload
602515
def __mod__(self, __value: Any) -> str: ...
603-
@overload
604-
def __mul__(self: LiteralString, __value: SupportsIndex) -> LiteralString: ...
605-
@overload
606516
def __mul__(self, __value: SupportsIndex) -> str: ... # type: ignore[misc]
607517
def __ne__(self, __value: object) -> bool: ...
608-
@overload
609-
def __rmul__(self: LiteralString, __value: SupportsIndex) -> LiteralString: ...
610-
@overload
611518
def __rmul__(self, __value: SupportsIndex) -> str: ... # type: ignore[misc]
612519
def __getnewargs__(self) -> tuple[str]: ...
613520

0 commit comments

Comments
 (0)