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