@@ -56,7 +56,6 @@ from typing import ( # noqa: Y022
5656from typing_extensions import (
5757 Concatenate ,
5858 Literal ,
59- LiteralString ,
6059 ParamSpec ,
6160 Self ,
6261 SupportsIndex ,
@@ -442,38 +441,20 @@ class str(Sequence[str]):
442441 def __new__ (cls , object : object = ...) -> Self : ...
443442 @overload
444443 def __new__ (cls , object : ReadableBuffer , encoding : str = ..., errors : str = ...) -> Self : ...
445- @overload
446- def capitalize (self : LiteralString ) -> LiteralString : ...
447- @overload
448444 def capitalize (self ) -> str : ... # type: ignore[misc]
449- @overload
450- def casefold (self : LiteralString ) -> LiteralString : ...
451- @overload
452445 def casefold (self ) -> str : ... # type: ignore[misc]
453- @overload
454- def center (self : LiteralString , __width : SupportsIndex , __fillchar : LiteralString = " " ) -> LiteralString : ...
455- @overload
456446 def center (self , __width : SupportsIndex , __fillchar : str = " " ) -> str : ... # type: ignore[misc]
457447 def count (self , x : str , __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...) -> int : ...
458448 def encode (self , encoding : str = "utf-8" , errors : str = "strict" ) -> bytes : ...
459449 def endswith (
460450 self , __suffix : str | tuple [str , ...], __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...
461451 ) -> bool : ...
462452 if sys .version_info >= (3 , 8 ):
463- @overload
464- def expandtabs (self : LiteralString , tabsize : SupportsIndex = 8 ) -> LiteralString : ...
465- @overload
466453 def expandtabs (self , tabsize : SupportsIndex = 8 ) -> str : ... # type: ignore[misc]
467454 else :
468- @overload
469- def expandtabs (self : LiteralString , tabsize : int = 8 ) -> LiteralString : ...
470- @overload
471455 def expandtabs (self , tabsize : int = 8 ) -> str : ... # type: ignore[misc]
472456
473457 def find (self , __sub : str , __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...) -> int : ...
474- @overload
475- def format (self : LiteralString , * args : LiteralString , ** kwargs : LiteralString ) -> LiteralString : ...
476- @overload
477458 def format (self , * args : object , ** kwargs : object ) -> str : ...
478459 def format_map (self , map : _FormatMapMapping ) -> str : ...
479460 def index (self , __sub : str , __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...) -> int : ...
@@ -489,91 +470,32 @@ class str(Sequence[str]):
489470 def isspace (self ) -> bool : ...
490471 def istitle (self ) -> bool : ...
491472 def isupper (self ) -> bool : ...
492- @overload
493- def join (self : LiteralString , __iterable : Iterable [LiteralString ]) -> LiteralString : ...
494- @overload
495473 def join (self , __iterable : Iterable [str ]) -> str : ... # type: ignore[misc]
496- @overload
497- def ljust (self : LiteralString , __width : SupportsIndex , __fillchar : LiteralString = " " ) -> LiteralString : ...
498- @overload
499474 def ljust (self , __width : SupportsIndex , __fillchar : str = " " ) -> str : ... # type: ignore[misc]
500- @overload
501- def lower (self : LiteralString ) -> LiteralString : ...
502- @overload
503475 def lower (self ) -> str : ... # type: ignore[misc]
504- @overload
505- def lstrip (self : LiteralString , __chars : LiteralString | None = None ) -> LiteralString : ...
506- @overload
507476 def lstrip (self , __chars : str | None = None ) -> str : ... # type: ignore[misc]
508- @overload
509- def partition (self : LiteralString , __sep : LiteralString ) -> tuple [LiteralString , LiteralString , LiteralString ]: ...
510- @overload
511477 def partition (self , __sep : str ) -> tuple [str , str , str ]: ... # type: ignore[misc]
512- @overload
513- def replace (
514- self : LiteralString , __old : LiteralString , __new : LiteralString , __count : SupportsIndex = - 1
515- ) -> LiteralString : ...
516- @overload
517478 def replace (self , __old : str , __new : str , __count : SupportsIndex = - 1 ) -> str : ... # type: ignore[misc]
518479 if sys .version_info >= (3 , 9 ):
519- @overload
520- def removeprefix (self : LiteralString , __prefix : LiteralString ) -> LiteralString : ...
521- @overload
522480 def removeprefix (self , __prefix : str ) -> str : ... # type: ignore[misc]
523- @overload
524- def removesuffix (self : LiteralString , __suffix : LiteralString ) -> LiteralString : ...
525- @overload
526481 def removesuffix (self , __suffix : str ) -> str : ... # type: ignore[misc]
527482
528483 def rfind (self , __sub : str , __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...) -> int : ...
529484 def rindex (self , __sub : str , __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...) -> int : ...
530- @overload
531- def rjust (self : LiteralString , __width : SupportsIndex , __fillchar : LiteralString = " " ) -> LiteralString : ...
532- @overload
533485 def rjust (self , __width : SupportsIndex , __fillchar : str = " " ) -> str : ... # type: ignore[misc]
534- @overload
535- def rpartition (self : LiteralString , __sep : LiteralString ) -> tuple [LiteralString , LiteralString , LiteralString ]: ...
536- @overload
537486 def rpartition (self , __sep : str ) -> tuple [str , str , str ]: ... # type: ignore[misc]
538- @overload
539- def rsplit (self : LiteralString , sep : LiteralString | None = None , maxsplit : SupportsIndex = - 1 ) -> list [LiteralString ]: ...
540- @overload
541487 def rsplit (self , sep : str | None = None , maxsplit : SupportsIndex = - 1 ) -> list [str ]: ... # type: ignore[misc]
542- @overload
543- def rstrip (self : LiteralString , __chars : LiteralString | None = None ) -> LiteralString : ...
544- @overload
545488 def rstrip (self , __chars : str | None = None ) -> str : ... # type: ignore[misc]
546- @overload
547- def split (self : LiteralString , sep : LiteralString | None = None , maxsplit : SupportsIndex = - 1 ) -> list [LiteralString ]: ...
548- @overload
549489 def split (self , sep : str | None = None , maxsplit : SupportsIndex = - 1 ) -> list [str ]: ... # type: ignore[misc]
550- @overload
551- def splitlines (self : LiteralString , keepends : bool = False ) -> list [LiteralString ]: ...
552- @overload
553490 def splitlines (self , keepends : bool = False ) -> list [str ]: ... # type: ignore[misc]
554491 def startswith (
555492 self , __prefix : str | tuple [str , ...], __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...
556493 ) -> bool : ...
557- @overload
558- def strip (self : LiteralString , __chars : LiteralString | None = None ) -> LiteralString : ...
559- @overload
560494 def strip (self , __chars : str | None = None ) -> str : ... # type: ignore[misc]
561- @overload
562- def swapcase (self : LiteralString ) -> LiteralString : ...
563- @overload
564495 def swapcase (self ) -> str : ... # type: ignore[misc]
565- @overload
566- def title (self : LiteralString ) -> LiteralString : ...
567- @overload
568496 def title (self ) -> str : ... # type: ignore[misc]
569497 def translate (self , __table : _TranslateTable ) -> str : ...
570- @overload
571- def upper (self : LiteralString ) -> LiteralString : ...
572- @overload
573498 def upper (self ) -> str : ... # type: ignore[misc]
574- @overload
575- def zfill (self : LiteralString , __width : SupportsIndex ) -> LiteralString : ...
576- @overload
577499 def zfill (self , __width : SupportsIndex ) -> str : ... # type: ignore[misc]
578500 @staticmethod
579501 @overload
@@ -584,9 +506,6 @@ class str(Sequence[str]):
584506 @staticmethod
585507 @overload
586508 def maketrans (__x : str , __y : str , __z : str ) -> dict [int , int | None ]: ...
587- @overload
588- def __add__ (self : LiteralString , __value : LiteralString ) -> LiteralString : ...
589- @overload
590509 def __add__ (self , __value : str ) -> str : ... # type: ignore[misc]
591510 # Incompatible with Sequence.__contains__
592511 def __contains__ (self , __key : str ) -> bool : ... # type: ignore[override]
@@ -595,25 +514,13 @@ class str(Sequence[str]):
595514 def __getitem__ (self , __key : SupportsIndex | slice ) -> str : ...
596515 def __gt__ (self , __value : str ) -> bool : ...
597516 def __hash__ (self ) -> int : ...
598- @overload
599- def __iter__ (self : LiteralString ) -> Iterator [LiteralString ]: ...
600- @overload
601517 def __iter__ (self ) -> Iterator [str ]: ... # type: ignore[misc]
602518 def __le__ (self , __value : str ) -> bool : ...
603519 def __len__ (self ) -> int : ...
604520 def __lt__ (self , __value : str ) -> bool : ...
605- @overload
606- def __mod__ (self : LiteralString , __value : LiteralString | tuple [LiteralString , ...]) -> LiteralString : ...
607- @overload
608521 def __mod__ (self , __value : Any ) -> str : ...
609- @overload
610- def __mul__ (self : LiteralString , __value : SupportsIndex ) -> LiteralString : ...
611- @overload
612522 def __mul__ (self , __value : SupportsIndex ) -> str : ... # type: ignore[misc]
613523 def __ne__ (self , __value : object ) -> bool : ...
614- @overload
615- def __rmul__ (self : LiteralString , __value : SupportsIndex ) -> LiteralString : ...
616- @overload
617524 def __rmul__ (self , __value : SupportsIndex ) -> str : ... # type: ignore[misc]
618525 def __getnewargs__ (self ) -> tuple [str ]: ...
619526
0 commit comments