@@ -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 ,
@@ -453,31 +452,16 @@ class str(Sequence[str]):
453
452
def __new__ (cls , object : object = ...) -> Self : ...
454
453
@overload
455
454
def __new__ (cls , object : ReadableBuffer , encoding : str = ..., errors : str = ...) -> Self : ...
456
- @overload
457
- def capitalize (self : LiteralString ) -> LiteralString : ...
458
- @overload
459
455
def capitalize (self ) -> str : ... # type: ignore[misc]
460
- @overload
461
- def casefold (self : LiteralString ) -> LiteralString : ...
462
- @overload
463
456
def casefold (self ) -> str : ... # type: ignore[misc]
464
- @overload
465
- def center (self : LiteralString , width : SupportsIndex , fillchar : LiteralString = " " , / ) -> LiteralString : ...
466
- @overload
467
457
def center (self , width : SupportsIndex , fillchar : str = " " , / ) -> str : ... # type: ignore[misc]
468
458
def count (self , sub : str , start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., / ) -> int : ...
469
459
def encode (self , encoding : str = "utf-8" , errors : str = "strict" ) -> bytes : ...
470
460
def endswith (
471
461
self , suffix : str | tuple [str , ...], start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., /
472
462
) -> bool : ...
473
- @overload
474
- def expandtabs (self : LiteralString , tabsize : SupportsIndex = 8 ) -> LiteralString : ...
475
- @overload
476
463
def expandtabs (self , tabsize : SupportsIndex = 8 ) -> str : ... # type: ignore[misc]
477
464
def find (self , sub : str , start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., / ) -> int : ...
478
- @overload
479
- def format (self : LiteralString , * args : LiteralString , ** kwargs : LiteralString ) -> LiteralString : ...
480
- @overload
481
465
def format (self , * args : object , ** kwargs : object ) -> str : ...
482
466
def format_map (self , mapping : _FormatMapMapping , / ) -> str : ...
483
467
def index (self , sub : str , start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., / ) -> int : ...
@@ -493,98 +477,34 @@ class str(Sequence[str]):
493
477
def isspace (self ) -> bool : ...
494
478
def istitle (self ) -> bool : ...
495
479
def isupper (self ) -> bool : ...
496
- @overload
497
- def join (self : LiteralString , iterable : Iterable [LiteralString ], / ) -> LiteralString : ...
498
- @overload
499
480
def join (self , iterable : Iterable [str ], / ) -> str : ... # type: ignore[misc]
500
- @overload
501
- def ljust (self : LiteralString , width : SupportsIndex , fillchar : LiteralString = " " , / ) -> LiteralString : ...
502
- @overload
503
481
def ljust (self , width : SupportsIndex , fillchar : str = " " , / ) -> str : ... # type: ignore[misc]
504
- @overload
505
- def lower (self : LiteralString ) -> LiteralString : ...
506
- @overload
507
482
def lower (self ) -> str : ... # type: ignore[misc]
508
- @overload
509
- def lstrip (self : LiteralString , chars : LiteralString | None = None , / ) -> LiteralString : ...
510
- @overload
511
483
def lstrip (self , chars : str | None = None , / ) -> str : ... # type: ignore[misc]
512
- @overload
513
- def partition (self : LiteralString , sep : LiteralString , / ) -> tuple [LiteralString , LiteralString , LiteralString ]: ...
514
- @overload
515
484
def partition (self , sep : str , / ) -> tuple [str , str , str ]: ... # type: ignore[misc]
516
485
if sys .version_info >= (3 , 13 ):
517
- @overload
518
- def replace (
519
- self : LiteralString , old : LiteralString , new : LiteralString , / , count : SupportsIndex = - 1
520
- ) -> LiteralString : ...
521
- @overload
522
486
def replace (self , old : str , new : str , / , count : SupportsIndex = - 1 ) -> str : ... # type: ignore[misc]
523
487
else :
524
- @overload
525
- def replace (
526
- self : LiteralString , old : LiteralString , new : LiteralString , count : SupportsIndex = - 1 , /
527
- ) -> LiteralString : ...
528
- @overload
529
488
def replace (self , old : str , new : str , count : SupportsIndex = - 1 , / ) -> str : ... # type: ignore[misc]
530
489
531
- @overload
532
- def removeprefix (self : LiteralString , prefix : LiteralString , / ) -> LiteralString : ...
533
- @overload
534
490
def removeprefix (self , prefix : str , / ) -> str : ... # type: ignore[misc]
535
- @overload
536
- def removesuffix (self : LiteralString , suffix : LiteralString , / ) -> LiteralString : ...
537
- @overload
538
491
def removesuffix (self , suffix : str , / ) -> str : ... # type: ignore[misc]
539
492
def rfind (self , sub : str , start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., / ) -> int : ...
540
493
def rindex (self , sub : str , start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., / ) -> int : ...
541
- @overload
542
- def rjust (self : LiteralString , width : SupportsIndex , fillchar : LiteralString = " " , / ) -> LiteralString : ...
543
- @overload
544
494
def rjust (self , width : SupportsIndex , fillchar : str = " " , / ) -> str : ... # type: ignore[misc]
545
- @overload
546
- def rpartition (self : LiteralString , sep : LiteralString , / ) -> tuple [LiteralString , LiteralString , LiteralString ]: ...
547
- @overload
548
495
def rpartition (self , sep : str , / ) -> tuple [str , str , str ]: ... # type: ignore[misc]
549
- @overload
550
- def rsplit (self : LiteralString , sep : LiteralString | None = None , maxsplit : SupportsIndex = - 1 ) -> list [LiteralString ]: ...
551
- @overload
552
496
def rsplit (self , sep : str | None = None , maxsplit : SupportsIndex = - 1 ) -> list [str ]: ... # type: ignore[misc]
553
- @overload
554
- def rstrip (self : LiteralString , chars : LiteralString | None = None , / ) -> LiteralString : ...
555
- @overload
556
497
def rstrip (self , chars : str | None = None , / ) -> str : ... # type: ignore[misc]
557
- @overload
558
- def split (self : LiteralString , sep : LiteralString | None = None , maxsplit : SupportsIndex = - 1 ) -> list [LiteralString ]: ...
559
- @overload
560
498
def split (self , sep : str | None = None , maxsplit : SupportsIndex = - 1 ) -> list [str ]: ... # type: ignore[misc]
561
- @overload
562
- def splitlines (self : LiteralString , keepends : bool = False ) -> list [LiteralString ]: ...
563
- @overload
564
499
def splitlines (self , keepends : bool = False ) -> list [str ]: ... # type: ignore[misc]
565
500
def startswith (
566
501
self , prefix : str | tuple [str , ...], start : SupportsIndex | None = ..., end : SupportsIndex | None = ..., /
567
502
) -> bool : ...
568
- @overload
569
- def strip (self : LiteralString , chars : LiteralString | None = None , / ) -> LiteralString : ...
570
- @overload
571
503
def strip (self , chars : str | None = None , / ) -> str : ... # type: ignore[misc]
572
- @overload
573
- def swapcase (self : LiteralString ) -> LiteralString : ...
574
- @overload
575
504
def swapcase (self ) -> str : ... # type: ignore[misc]
576
- @overload
577
- def title (self : LiteralString ) -> LiteralString : ...
578
- @overload
579
505
def title (self ) -> str : ... # type: ignore[misc]
580
506
def translate (self , table : _TranslateTable , / ) -> str : ...
581
- @overload
582
- def upper (self : LiteralString ) -> LiteralString : ...
583
- @overload
584
507
def upper (self ) -> str : ... # type: ignore[misc]
585
- @overload
586
- def zfill (self : LiteralString , width : SupportsIndex , / ) -> LiteralString : ...
587
- @overload
588
508
def zfill (self , width : SupportsIndex , / ) -> str : ... # type: ignore[misc]
589
509
@staticmethod
590
510
@overload
@@ -595,39 +515,21 @@ class str(Sequence[str]):
595
515
@staticmethod
596
516
@overload
597
517
def maketrans (x : str , y : str , z : str , / ) -> dict [int , int | None ]: ...
598
- @overload
599
- def __add__ (self : LiteralString , value : LiteralString , / ) -> LiteralString : ...
600
- @overload
601
518
def __add__ (self , value : str , / ) -> str : ... # type: ignore[misc]
602
519
# Incompatible with Sequence.__contains__
603
520
def __contains__ (self , key : str , / ) -> bool : ... # type: ignore[override]
604
521
def __eq__ (self , value : object , / ) -> bool : ...
605
522
def __ge__ (self , value : str , / ) -> bool : ...
606
- @overload
607
- def __getitem__ (self : LiteralString , key : SupportsIndex | slice , / ) -> LiteralString : ...
608
- @overload
609
- def __getitem__ (self , key : SupportsIndex | slice , / ) -> str : ... # type: ignore[misc]
523
+ def __getitem__ (self , key : SupportsIndex | slice , / ) -> str : ...
610
524
def __gt__ (self , value : str , / ) -> bool : ...
611
525
def __hash__ (self ) -> int : ...
612
- @overload
613
- def __iter__ (self : LiteralString ) -> Iterator [LiteralString ]: ...
614
- @overload
615
526
def __iter__ (self ) -> Iterator [str ]: ... # type: ignore[misc]
616
527
def __le__ (self , value : str , / ) -> bool : ...
617
528
def __len__ (self ) -> int : ...
618
529
def __lt__ (self , value : str , / ) -> bool : ...
619
- @overload
620
- def __mod__ (self : LiteralString , value : LiteralString | tuple [LiteralString , ...], / ) -> LiteralString : ...
621
- @overload
622
530
def __mod__ (self , value : Any , / ) -> str : ...
623
- @overload
624
- def __mul__ (self : LiteralString , value : SupportsIndex , / ) -> LiteralString : ...
625
- @overload
626
531
def __mul__ (self , value : SupportsIndex , / ) -> str : ... # type: ignore[misc]
627
532
def __ne__ (self , value : object , / ) -> bool : ...
628
- @overload
629
- def __rmul__ (self : LiteralString , value : SupportsIndex , / ) -> LiteralString : ...
630
- @overload
631
533
def __rmul__ (self , value : SupportsIndex , / ) -> str : ... # type: ignore[misc]
632
534
def __getnewargs__ (self ) -> tuple [str ]: ...
633
535
0 commit comments