@@ -61,7 +61,6 @@ from typing import ( # noqa: Y022
6161from typing_extensions import ( # noqa: Y023
6262 Concatenate ,
6363 Literal ,
64- LiteralString ,
6564 ParamSpec ,
6665 Self ,
6766 TypeAlias ,
@@ -435,31 +434,16 @@ class str(Sequence[str]):
435434 def __new__ (cls , object : object = ...) -> Self : ...
436435 @overload
437436 def __new__ (cls , object : ReadableBuffer , encoding : str = ..., errors : str = ...) -> Self : ...
438- @overload
439- def capitalize (self : LiteralString ) -> LiteralString : ...
440- @overload
441437 def capitalize (self ) -> str : ... # type: ignore[misc]
442- @overload
443- def casefold (self : LiteralString ) -> LiteralString : ...
444- @overload
445438 def casefold (self ) -> str : ... # type: ignore[misc]
446- @overload
447- def center (self : LiteralString , width : SupportsIndex , fillchar : LiteralString = " " , / ) -> LiteralString : ...
448- @overload
449439 def center (self , width : SupportsIndex , fillchar : str = " " , / ) -> str : ... # type: ignore[misc]
450440 def count (self , sub : str , start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., / ) -> int : ...
451441 def encode (self , encoding : str = "utf-8" , errors : str = "strict" ) -> bytes : ...
452442 def endswith (
453443 self , suffix : str | tuple [str , ...], start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., /
454444 ) -> bool : ...
455- @overload
456- def expandtabs (self : LiteralString , tabsize : SupportsIndex = 8 ) -> LiteralString : ...
457- @overload
458445 def expandtabs (self , tabsize : SupportsIndex = 8 ) -> str : ... # type: ignore[misc]
459446 def find (self , sub : str , start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., / ) -> int : ...
460- @overload
461- def format (self : LiteralString , * args : LiteralString , ** kwargs : LiteralString ) -> LiteralString : ...
462- @overload
463447 def format (self , * args : object , ** kwargs : object ) -> str : ...
464448 def format_map (self , map : _FormatMapMapping ) -> str : ...
465449 def index (self , sub : str , start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., / ) -> int : ...
@@ -475,89 +459,32 @@ class str(Sequence[str]):
475459 def isspace (self ) -> bool : ...
476460 def istitle (self ) -> bool : ...
477461 def isupper (self ) -> bool : ...
478- @overload
479- def join (self : LiteralString , iterable : Iterable [LiteralString ], / ) -> LiteralString : ...
480- @overload
481462 def join (self , iterable : Iterable [str ], / ) -> str : ... # type: ignore[misc]
482- @overload
483- def ljust (self : LiteralString , width : SupportsIndex , fillchar : LiteralString = " " , / ) -> LiteralString : ...
484- @overload
485463 def ljust (self , width : SupportsIndex , fillchar : str = " " , / ) -> str : ... # type: ignore[misc]
486- @overload
487- def lower (self : LiteralString ) -> LiteralString : ...
488- @overload
489464 def lower (self ) -> str : ... # type: ignore[misc]
490- @overload
491- def lstrip (self : LiteralString , chars : LiteralString | None = None , / ) -> LiteralString : ...
492- @overload
493465 def lstrip (self , chars : str | None = None , / ) -> str : ... # type: ignore[misc]
494- @overload
495- def partition (self : LiteralString , sep : LiteralString , / ) -> tuple [LiteralString , LiteralString , LiteralString ]: ...
496- @overload
497466 def partition (self , sep : str , / ) -> tuple [str , str , str ]: ... # type: ignore[misc]
498- @overload
499- def replace (self : LiteralString , old : LiteralString , new : LiteralString , count : SupportsIndex = - 1 , / ) -> LiteralString : ...
500- @overload
501467 def replace (self , old : str , new : str , count : SupportsIndex = - 1 , / ) -> str : ... # type: ignore[misc]
502468 if sys .version_info >= (3 , 9 ):
503- @overload
504- def removeprefix (self : LiteralString , prefix : LiteralString , / ) -> LiteralString : ...
505- @overload
506469 def removeprefix (self , prefix : str , / ) -> str : ... # type: ignore[misc]
507- @overload
508- def removesuffix (self : LiteralString , suffix : LiteralString , / ) -> LiteralString : ...
509- @overload
510470 def removesuffix (self , suffix : str , / ) -> str : ... # type: ignore[misc]
511471
512472 def rfind (self , sub : str , start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., / ) -> int : ...
513473 def rindex (self , sub : str , start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., / ) -> int : ...
514- @overload
515- def rjust (self : LiteralString , width : SupportsIndex , fillchar : LiteralString = " " , / ) -> LiteralString : ...
516- @overload
517474 def rjust (self , width : SupportsIndex , fillchar : str = " " , / ) -> str : ... # type: ignore[misc]
518- @overload
519- def rpartition (self : LiteralString , sep : LiteralString , / ) -> tuple [LiteralString , LiteralString , LiteralString ]: ...
520- @overload
521475 def rpartition (self , sep : str , / ) -> tuple [str , str , str ]: ... # type: ignore[misc]
522- @overload
523- def rsplit (self : LiteralString , sep : LiteralString | None = None , maxsplit : SupportsIndex = - 1 ) -> list [LiteralString ]: ...
524- @overload
525476 def rsplit (self , sep : str | None = None , maxsplit : SupportsIndex = - 1 ) -> list [str ]: ... # type: ignore[misc]
526- @overload
527- def rstrip (self : LiteralString , chars : LiteralString | None = None , / ) -> LiteralString : ...
528- @overload
529477 def rstrip (self , chars : str | None = None , / ) -> str : ... # type: ignore[misc]
530- @overload
531- def split (self : LiteralString , sep : LiteralString | None = None , maxsplit : SupportsIndex = - 1 ) -> list [LiteralString ]: ...
532- @overload
533478 def split (self , sep : str | None = None , maxsplit : SupportsIndex = - 1 ) -> list [str ]: ... # type: ignore[misc]
534- @overload
535- def splitlines (self : LiteralString , keepends : bool = False ) -> list [LiteralString ]: ...
536- @overload
537479 def splitlines (self , keepends : bool = False ) -> list [str ]: ... # type: ignore[misc]
538480 def startswith (
539481 self , prefix : str | tuple [str , ...], start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., /
540482 ) -> bool : ...
541- @overload
542- def strip (self : LiteralString , chars : LiteralString | None = None , / ) -> LiteralString : ...
543- @overload
544483 def strip (self , chars : str | None = None , / ) -> str : ... # type: ignore[misc]
545- @overload
546- def swapcase (self : LiteralString ) -> LiteralString : ...
547- @overload
548484 def swapcase (self ) -> str : ... # type: ignore[misc]
549- @overload
550- def title (self : LiteralString ) -> LiteralString : ...
551- @overload
552485 def title (self ) -> str : ... # type: ignore[misc]
553486 def translate (self , table : _TranslateTable , / ) -> str : ...
554- @overload
555- def upper (self : LiteralString ) -> LiteralString : ...
556- @overload
557487 def upper (self ) -> str : ... # type: ignore[misc]
558- @overload
559- def zfill (self : LiteralString , width : SupportsIndex , / ) -> LiteralString : ...
560- @overload
561488 def zfill (self , width : SupportsIndex , / ) -> str : ... # type: ignore[misc]
562489 @staticmethod
563490 @overload
@@ -568,9 +495,6 @@ class str(Sequence[str]):
568495 @staticmethod
569496 @overload
570497 def maketrans (x : str , y : str , z : str , / ) -> dict [int , int | None ]: ...
571- @overload
572- def __add__ (self : LiteralString , value : LiteralString , / ) -> LiteralString : ...
573- @overload
574498 def __add__ (self , value : str , / ) -> str : ... # type: ignore[misc]
575499 # Incompatible with Sequence.__contains__
576500 def __contains__ (self , key : str , / ) -> bool : ... # type: ignore[override]
@@ -579,25 +503,13 @@ class str(Sequence[str]):
579503 def __getitem__ (self , key : SupportsIndex | slice , / ) -> str : ...
580504 def __gt__ (self , value : str , / ) -> bool : ...
581505 def __hash__ (self ) -> int : ...
582- @overload
583- def __iter__ (self : LiteralString ) -> Iterator [LiteralString ]: ...
584- @overload
585506 def __iter__ (self ) -> Iterator [str ]: ... # type: ignore[misc]
586507 def __le__ (self , value : str , / ) -> bool : ...
587508 def __len__ (self ) -> int : ...
588509 def __lt__ (self , value : str , / ) -> bool : ...
589- @overload
590- def __mod__ (self : LiteralString , value : LiteralString | tuple [LiteralString , ...], / ) -> LiteralString : ...
591- @overload
592510 def __mod__ (self , value : Any , / ) -> str : ...
593- @overload
594- def __mul__ (self : LiteralString , value : SupportsIndex , / ) -> LiteralString : ...
595- @overload
596511 def __mul__ (self , value : SupportsIndex , / ) -> str : ... # type: ignore[misc]
597512 def __ne__ (self , value : object , / ) -> bool : ...
598- @overload
599- def __rmul__ (self : LiteralString , value : SupportsIndex , / ) -> LiteralString : ...
600- @overload
601513 def __rmul__ (self , value : SupportsIndex , / ) -> str : ... # type: ignore[misc]
602514 def __getnewargs__ (self ) -> tuple [str ]: ...
603515
0 commit comments