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