@@ -63,7 +63,6 @@ from typing import ( # noqa: Y022,UP035
6363from typing_extensions import ( # noqa: Y023
6464 Concatenate ,
6565 Literal ,
66- LiteralString ,
6766 ParamSpec ,
6867 Self ,
6968 TypeAlias ,
@@ -463,31 +462,16 @@ class str(Sequence[str]):
463462 def __new__ (cls , object : object = ...) -> Self : ...
464463 @overload
465464 def __new__ (cls , object : ReadableBuffer , encoding : str = ..., errors : str = ...) -> Self : ...
466- @overload
467- def capitalize (self : LiteralString ) -> LiteralString : ...
468- @overload
469465 def capitalize (self ) -> str : ... # type: ignore[misc]
470- @overload
471- def casefold (self : LiteralString ) -> LiteralString : ...
472- @overload
473466 def casefold (self ) -> str : ... # type: ignore[misc]
474- @overload
475- def center (self : LiteralString , width : SupportsIndex , fillchar : LiteralString = " " , / ) -> LiteralString : ...
476- @overload
477467 def center (self , width : SupportsIndex , fillchar : str = " " , / ) -> str : ... # type: ignore[misc]
478468 def count (self , sub : str , start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., / ) -> int : ...
479469 def encode (self , encoding : str = "utf-8" , errors : str = "strict" ) -> bytes : ...
480470 def endswith (
481471 self , suffix : str | tuple [str , ...], start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., /
482472 ) -> bool : ...
483- @overload
484- def expandtabs (self : LiteralString , tabsize : SupportsIndex = 8 ) -> LiteralString : ...
485- @overload
486473 def expandtabs (self , tabsize : SupportsIndex = 8 ) -> str : ... # type: ignore[misc]
487474 def find (self , sub : str , start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., / ) -> int : ...
488- @overload
489- def format (self : LiteralString , * args : LiteralString , ** kwargs : LiteralString ) -> LiteralString : ...
490- @overload
491475 def format (self , * args : object , ** kwargs : object ) -> str : ...
492476 def format_map (self , mapping : _FormatMapMapping , / ) -> str : ...
493477 def index (self , sub : str , start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., / ) -> int : ...
@@ -503,98 +487,34 @@ class str(Sequence[str]):
503487 def isspace (self ) -> bool : ...
504488 def istitle (self ) -> bool : ...
505489 def isupper (self ) -> bool : ...
506- @overload
507- def join (self : LiteralString , iterable : Iterable [LiteralString ], / ) -> LiteralString : ...
508- @overload
509490 def join (self , iterable : Iterable [str ], / ) -> str : ... # type: ignore[misc]
510- @overload
511- def ljust (self : LiteralString , width : SupportsIndex , fillchar : LiteralString = " " , / ) -> LiteralString : ...
512- @overload
513491 def ljust (self , width : SupportsIndex , fillchar : str = " " , / ) -> str : ... # type: ignore[misc]
514- @overload
515- def lower (self : LiteralString ) -> LiteralString : ...
516- @overload
517492 def lower (self ) -> str : ... # type: ignore[misc]
518- @overload
519- def lstrip (self : LiteralString , chars : LiteralString | None = None , / ) -> LiteralString : ...
520- @overload
521493 def lstrip (self , chars : str | None = None , / ) -> str : ... # type: ignore[misc]
522- @overload
523- def partition (self : LiteralString , sep : LiteralString , / ) -> tuple [LiteralString , LiteralString , LiteralString ]: ...
524- @overload
525494 def partition (self , sep : str , / ) -> tuple [str , str , str ]: ... # type: ignore[misc]
526495 if sys .version_info >= (3 , 13 ):
527- @overload
528- def replace (
529- self : LiteralString , old : LiteralString , new : LiteralString , / , count : SupportsIndex = - 1
530- ) -> LiteralString : ...
531- @overload
532496 def replace (self , old : str , new : str , / , count : SupportsIndex = - 1 ) -> str : ... # type: ignore[misc]
533497 else :
534- @overload
535- def replace (
536- self : LiteralString , old : LiteralString , new : LiteralString , count : SupportsIndex = - 1 , /
537- ) -> LiteralString : ...
538- @overload
539498 def replace (self , old : str , new : str , count : SupportsIndex = - 1 , / ) -> str : ... # type: ignore[misc]
540499
541- @overload
542- def removeprefix (self : LiteralString , prefix : LiteralString , / ) -> LiteralString : ...
543- @overload
544500 def removeprefix (self , prefix : str , / ) -> str : ... # type: ignore[misc]
545- @overload
546- def removesuffix (self : LiteralString , suffix : LiteralString , / ) -> LiteralString : ...
547- @overload
548501 def removesuffix (self , suffix : str , / ) -> str : ... # type: ignore[misc]
549502 def rfind (self , sub : str , start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., / ) -> int : ...
550503 def rindex (self , sub : str , start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., / ) -> int : ...
551- @overload
552- def rjust (self : LiteralString , width : SupportsIndex , fillchar : LiteralString = " " , / ) -> LiteralString : ...
553- @overload
554504 def rjust (self , width : SupportsIndex , fillchar : str = " " , / ) -> str : ... # type: ignore[misc]
555- @overload
556- def rpartition (self : LiteralString , sep : LiteralString , / ) -> tuple [LiteralString , LiteralString , LiteralString ]: ...
557- @overload
558505 def rpartition (self , sep : str , / ) -> tuple [str , str , str ]: ... # type: ignore[misc]
559- @overload
560- def rsplit (self : LiteralString , sep : LiteralString | None = None , maxsplit : SupportsIndex = - 1 ) -> list [LiteralString ]: ...
561- @overload
562506 def rsplit (self , sep : str | None = None , maxsplit : SupportsIndex = - 1 ) -> list [str ]: ... # type: ignore[misc]
563- @overload
564- def rstrip (self : LiteralString , chars : LiteralString | None = None , / ) -> LiteralString : ...
565- @overload
566507 def rstrip (self , chars : str | None = None , / ) -> str : ... # type: ignore[misc]
567- @overload
568- def split (self : LiteralString , sep : LiteralString | None = None , maxsplit : SupportsIndex = - 1 ) -> list [LiteralString ]: ...
569- @overload
570508 def split (self , sep : str | None = None , maxsplit : SupportsIndex = - 1 ) -> list [str ]: ... # type: ignore[misc]
571- @overload
572- def splitlines (self : LiteralString , keepends : bool = False ) -> list [LiteralString ]: ...
573- @overload
574509 def splitlines (self , keepends : bool = False ) -> list [str ]: ... # type: ignore[misc]
575510 def startswith (
576511 self , prefix : str | tuple [str , ...], start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., /
577512 ) -> bool : ...
578- @overload
579- def strip (self : LiteralString , chars : LiteralString | None = None , / ) -> LiteralString : ...
580- @overload
581513 def strip (self , chars : str | None = None , / ) -> str : ... # type: ignore[misc]
582- @overload
583- def swapcase (self : LiteralString ) -> LiteralString : ...
584- @overload
585514 def swapcase (self ) -> str : ... # type: ignore[misc]
586- @overload
587- def title (self : LiteralString ) -> LiteralString : ...
588- @overload
589515 def title (self ) -> str : ... # type: ignore[misc]
590516 def translate (self , table : _TranslateTable , / ) -> str : ...
591- @overload
592- def upper (self : LiteralString ) -> LiteralString : ...
593- @overload
594517 def upper (self ) -> str : ... # type: ignore[misc]
595- @overload
596- def zfill (self : LiteralString , width : SupportsIndex , / ) -> LiteralString : ...
597- @overload
598518 def zfill (self , width : SupportsIndex , / ) -> str : ... # type: ignore[misc]
599519 @staticmethod
600520 @overload
@@ -605,39 +525,21 @@ class str(Sequence[str]):
605525 @staticmethod
606526 @overload
607527 def maketrans (x : str , y : str , z : str , / ) -> dict [int , int | None ]: ...
608- @overload
609- def __add__ (self : LiteralString , value : LiteralString , / ) -> LiteralString : ...
610- @overload
611528 def __add__ (self , value : str , / ) -> str : ... # type: ignore[misc]
612529 # Incompatible with Sequence.__contains__
613530 def __contains__ (self , key : str , / ) -> bool : ... # type: ignore[override]
614531 def __eq__ (self , value : object , / ) -> bool : ...
615532 def __ge__ (self , value : str , / ) -> bool : ...
616- @overload
617- def __getitem__ (self : LiteralString , key : SupportsIndex | slice , / ) -> LiteralString : ...
618- @overload
619- def __getitem__ (self , key : SupportsIndex | slice , / ) -> str : ... # type: ignore[misc]
533+ def __getitem__ (self , key : SupportsIndex | slice , / ) -> str : ...
620534 def __gt__ (self , value : str , / ) -> bool : ...
621535 def __hash__ (self ) -> int : ...
622- @overload
623- def __iter__ (self : LiteralString ) -> Iterator [LiteralString ]: ...
624- @overload
625536 def __iter__ (self ) -> Iterator [str ]: ... # type: ignore[misc]
626537 def __le__ (self , value : str , / ) -> bool : ...
627538 def __len__ (self ) -> int : ...
628539 def __lt__ (self , value : str , / ) -> bool : ...
629- @overload
630- def __mod__ (self : LiteralString , value : LiteralString | tuple [LiteralString , ...], / ) -> LiteralString : ...
631- @overload
632540 def __mod__ (self , value : Any , / ) -> str : ...
633- @overload
634- def __mul__ (self : LiteralString , value : SupportsIndex , / ) -> LiteralString : ...
635- @overload
636541 def __mul__ (self , value : SupportsIndex , / ) -> str : ... # type: ignore[misc]
637542 def __ne__ (self , value : object , / ) -> bool : ...
638- @overload
639- def __rmul__ (self : LiteralString , value : SupportsIndex , / ) -> LiteralString : ...
640- @overload
641543 def __rmul__ (self , value : SupportsIndex , / ) -> str : ... # type: ignore[misc]
642544 def __getnewargs__ (self ) -> tuple [str ]: ...
643545
0 commit comments