@@ -63,7 +63,6 @@ from typing import ( # noqa: Y022,UP035
63
63
from typing_extensions import ( # noqa: Y023
64
64
Concatenate ,
65
65
Literal ,
66
- LiteralString ,
67
66
ParamSpec ,
68
67
Self ,
69
68
TypeAlias ,
@@ -463,31 +462,16 @@ class str(Sequence[str]):
463
462
def __new__ (cls , object : object = ...) -> Self : ...
464
463
@overload
465
464
def __new__ (cls , object : ReadableBuffer , encoding : str = ..., errors : str = ...) -> Self : ...
466
- @overload
467
- def capitalize (self : LiteralString ) -> LiteralString : ...
468
- @overload
469
465
def capitalize (self ) -> str : ... # type: ignore[misc]
470
- @overload
471
- def casefold (self : LiteralString ) -> LiteralString : ...
472
- @overload
473
466
def casefold (self ) -> str : ... # type: ignore[misc]
474
- @overload
475
- def center (self : LiteralString , width : SupportsIndex , fillchar : LiteralString = " " , / ) -> LiteralString : ...
476
- @overload
477
467
def center (self , width : SupportsIndex , fillchar : str = " " , / ) -> str : ... # type: ignore[misc]
478
468
def count (self , sub : str , start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., / ) -> int : ...
479
469
def encode (self , encoding : str = "utf-8" , errors : str = "strict" ) -> bytes : ...
480
470
def endswith (
481
471
self , suffix : str | tuple [str , ...], start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., /
482
472
) -> bool : ...
483
- @overload
484
- def expandtabs (self : LiteralString , tabsize : SupportsIndex = 8 ) -> LiteralString : ...
485
- @overload
486
473
def expandtabs (self , tabsize : SupportsIndex = 8 ) -> str : ... # type: ignore[misc]
487
474
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
491
475
def format (self , * args : object , ** kwargs : object ) -> str : ...
492
476
def format_map (self , mapping : _FormatMapMapping , / ) -> str : ...
493
477
def index (self , sub : str , start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., / ) -> int : ...
@@ -503,98 +487,34 @@ class str(Sequence[str]):
503
487
def isspace (self ) -> bool : ...
504
488
def istitle (self ) -> bool : ...
505
489
def isupper (self ) -> bool : ...
506
- @overload
507
- def join (self : LiteralString , iterable : Iterable [LiteralString ], / ) -> LiteralString : ...
508
- @overload
509
490
def join (self , iterable : Iterable [str ], / ) -> str : ... # type: ignore[misc]
510
- @overload
511
- def ljust (self : LiteralString , width : SupportsIndex , fillchar : LiteralString = " " , / ) -> LiteralString : ...
512
- @overload
513
491
def ljust (self , width : SupportsIndex , fillchar : str = " " , / ) -> str : ... # type: ignore[misc]
514
- @overload
515
- def lower (self : LiteralString ) -> LiteralString : ...
516
- @overload
517
492
def lower (self ) -> str : ... # type: ignore[misc]
518
- @overload
519
- def lstrip (self : LiteralString , chars : LiteralString | None = None , / ) -> LiteralString : ...
520
- @overload
521
493
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
525
494
def partition (self , sep : str , / ) -> tuple [str , str , str ]: ... # type: ignore[misc]
526
495
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
532
496
def replace (self , old : str , new : str , / , count : SupportsIndex = - 1 ) -> str : ... # type: ignore[misc]
533
497
else :
534
- @overload
535
- def replace (
536
- self : LiteralString , old : LiteralString , new : LiteralString , count : SupportsIndex = - 1 , /
537
- ) -> LiteralString : ...
538
- @overload
539
498
def replace (self , old : str , new : str , count : SupportsIndex = - 1 , / ) -> str : ... # type: ignore[misc]
540
499
541
- @overload
542
- def removeprefix (self : LiteralString , prefix : LiteralString , / ) -> LiteralString : ...
543
- @overload
544
500
def removeprefix (self , prefix : str , / ) -> str : ... # type: ignore[misc]
545
- @overload
546
- def removesuffix (self : LiteralString , suffix : LiteralString , / ) -> LiteralString : ...
547
- @overload
548
501
def removesuffix (self , suffix : str , / ) -> str : ... # type: ignore[misc]
549
502
def rfind (self , sub : str , start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., / ) -> int : ...
550
503
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
554
504
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
558
505
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
562
506
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
566
507
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
570
508
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
574
509
def splitlines (self , keepends : bool = False ) -> list [str ]: ... # type: ignore[misc]
575
510
def startswith (
576
511
self , prefix : str | tuple [str , ...], start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., /
577
512
) -> bool : ...
578
- @overload
579
- def strip (self : LiteralString , chars : LiteralString | None = None , / ) -> LiteralString : ...
580
- @overload
581
513
def strip (self , chars : str | None = None , / ) -> str : ... # type: ignore[misc]
582
- @overload
583
- def swapcase (self : LiteralString ) -> LiteralString : ...
584
- @overload
585
514
def swapcase (self ) -> str : ... # type: ignore[misc]
586
- @overload
587
- def title (self : LiteralString ) -> LiteralString : ...
588
- @overload
589
515
def title (self ) -> str : ... # type: ignore[misc]
590
516
def translate (self , table : _TranslateTable , / ) -> str : ...
591
- @overload
592
- def upper (self : LiteralString ) -> LiteralString : ...
593
- @overload
594
517
def upper (self ) -> str : ... # type: ignore[misc]
595
- @overload
596
- def zfill (self : LiteralString , width : SupportsIndex , / ) -> LiteralString : ...
597
- @overload
598
518
def zfill (self , width : SupportsIndex , / ) -> str : ... # type: ignore[misc]
599
519
@staticmethod
600
520
@overload
@@ -605,39 +525,21 @@ class str(Sequence[str]):
605
525
@staticmethod
606
526
@overload
607
527
def maketrans (x : str , y : str , z : str , / ) -> dict [int , int | None ]: ...
608
- @overload
609
- def __add__ (self : LiteralString , value : LiteralString , / ) -> LiteralString : ...
610
- @overload
611
528
def __add__ (self , value : str , / ) -> str : ... # type: ignore[misc]
612
529
# Incompatible with Sequence.__contains__
613
530
def __contains__ (self , key : str , / ) -> bool : ... # type: ignore[override]
614
531
def __eq__ (self , value : object , / ) -> bool : ...
615
532
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 : ...
620
534
def __gt__ (self , value : str , / ) -> bool : ...
621
535
def __hash__ (self ) -> int : ...
622
- @overload
623
- def __iter__ (self : LiteralString ) -> Iterator [LiteralString ]: ...
624
- @overload
625
536
def __iter__ (self ) -> Iterator [str ]: ... # type: ignore[misc]
626
537
def __le__ (self , value : str , / ) -> bool : ...
627
538
def __len__ (self ) -> int : ...
628
539
def __lt__ (self , value : str , / ) -> bool : ...
629
- @overload
630
- def __mod__ (self : LiteralString , value : LiteralString | tuple [LiteralString , ...], / ) -> LiteralString : ...
631
- @overload
632
540
def __mod__ (self , value : Any , / ) -> str : ...
633
- @overload
634
- def __mul__ (self : LiteralString , value : SupportsIndex , / ) -> LiteralString : ...
635
- @overload
636
541
def __mul__ (self , value : SupportsIndex , / ) -> str : ... # type: ignore[misc]
637
542
def __ne__ (self , value : object , / ) -> bool : ...
638
- @overload
639
- def __rmul__ (self : LiteralString , value : SupportsIndex , / ) -> LiteralString : ...
640
- @overload
641
543
def __rmul__ (self , value : SupportsIndex , / ) -> str : ... # type: ignore[misc]
642
544
def __getnewargs__ (self ) -> tuple [str ]: ...
643
545
0 commit comments