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