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