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