@@ -57,7 +57,6 @@ from typing import ( # noqa: Y022
57
57
from typing_extensions import (
58
58
Concatenate ,
59
59
Literal ,
60
- LiteralString ,
61
60
ParamSpec ,
62
61
Self ,
63
62
SupportsIndex ,
@@ -445,38 +444,20 @@ 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 , x : 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
455
if sys .version_info >= (3 , 8 ):
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
else :
471
- @overload
472
- def expandtabs (self : LiteralString , tabsize : int = 8 ) -> LiteralString : ...
473
- @overload
474
458
def expandtabs (self , tabsize : int = 8 ) -> str : ... # type: ignore[misc]
475
459
476
460
def find (self , __sub : str , __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...) -> int : ...
477
- @overload
478
- def format (self : LiteralString , * args : LiteralString , ** kwargs : LiteralString ) -> LiteralString : ...
479
- @overload
480
461
def format (self , * args : object , ** kwargs : object ) -> str : ...
481
462
def format_map (self , map : _FormatMapMapping ) -> str : ...
482
463
def index (self , __sub : str , __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...) -> int : ...
@@ -492,91 +473,32 @@ class str(Sequence[str]):
492
473
def isspace (self ) -> bool : ...
493
474
def istitle (self ) -> bool : ...
494
475
def isupper (self ) -> bool : ...
495
- @overload
496
- def join (self : LiteralString , __iterable : Iterable [LiteralString ]) -> LiteralString : ...
497
- @overload
498
476
def join (self , __iterable : Iterable [str ]) -> str : ... # type: ignore[misc]
499
- @overload
500
- def ljust (self : LiteralString , __width : SupportsIndex , __fillchar : LiteralString = " " ) -> LiteralString : ...
501
- @overload
502
477
def ljust (self , __width : SupportsIndex , __fillchar : str = " " ) -> str : ... # type: ignore[misc]
503
- @overload
504
- def lower (self : LiteralString ) -> LiteralString : ...
505
- @overload
506
478
def lower (self ) -> str : ... # type: ignore[misc]
507
- @overload
508
- def lstrip (self : LiteralString , __chars : LiteralString | None = None ) -> LiteralString : ...
509
- @overload
510
479
def lstrip (self , __chars : str | None = None ) -> str : ... # type: ignore[misc]
511
- @overload
512
- def partition (self : LiteralString , __sep : LiteralString ) -> tuple [LiteralString , LiteralString , LiteralString ]: ...
513
- @overload
514
480
def partition (self , __sep : str ) -> tuple [str , str , str ]: ... # type: ignore[misc]
515
- @overload
516
- def replace (
517
- self : LiteralString , __old : LiteralString , __new : LiteralString , __count : SupportsIndex = - 1
518
- ) -> LiteralString : ...
519
- @overload
520
481
def replace (self , __old : str , __new : str , __count : SupportsIndex = - 1 ) -> str : ... # type: ignore[misc]
521
482
if sys .version_info >= (3 , 9 ):
522
- @overload
523
- def removeprefix (self : LiteralString , __prefix : LiteralString ) -> LiteralString : ...
524
- @overload
525
483
def removeprefix (self , __prefix : str ) -> str : ... # type: ignore[misc]
526
- @overload
527
- def removesuffix (self : LiteralString , __suffix : LiteralString ) -> LiteralString : ...
528
- @overload
529
484
def removesuffix (self , __suffix : str ) -> str : ... # type: ignore[misc]
530
485
531
486
def rfind (self , __sub : str , __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...) -> int : ...
532
487
def rindex (self , __sub : str , __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...) -> int : ...
533
- @overload
534
- def rjust (self : LiteralString , __width : SupportsIndex , __fillchar : LiteralString = " " ) -> LiteralString : ...
535
- @overload
536
488
def rjust (self , __width : SupportsIndex , __fillchar : str = " " ) -> str : ... # type: ignore[misc]
537
- @overload
538
- def rpartition (self : LiteralString , __sep : LiteralString ) -> tuple [LiteralString , LiteralString , LiteralString ]: ...
539
- @overload
540
489
def rpartition (self , __sep : str ) -> tuple [str , str , str ]: ... # type: ignore[misc]
541
- @overload
542
- def rsplit (self : LiteralString , sep : LiteralString | None = None , maxsplit : SupportsIndex = - 1 ) -> list [LiteralString ]: ...
543
- @overload
544
490
def rsplit (self , sep : str | None = None , maxsplit : SupportsIndex = - 1 ) -> list [str ]: ... # type: ignore[misc]
545
- @overload
546
- def rstrip (self : LiteralString , __chars : LiteralString | None = None ) -> LiteralString : ...
547
- @overload
548
491
def rstrip (self , __chars : str | None = None ) -> str : ... # type: ignore[misc]
549
- @overload
550
- def split (self : LiteralString , sep : LiteralString | None = None , maxsplit : SupportsIndex = - 1 ) -> list [LiteralString ]: ...
551
- @overload
552
492
def split (self , sep : str | None = None , maxsplit : SupportsIndex = - 1 ) -> list [str ]: ... # type: ignore[misc]
553
- @overload
554
- def splitlines (self : LiteralString , keepends : bool = False ) -> list [LiteralString ]: ...
555
- @overload
556
493
def splitlines (self , keepends : bool = False ) -> list [str ]: ... # type: ignore[misc]
557
494
def startswith (
558
495
self , __prefix : str | tuple [str , ...], __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...
559
496
) -> bool : ...
560
- @overload
561
- def strip (self : LiteralString , __chars : LiteralString | None = None ) -> LiteralString : ...
562
- @overload
563
497
def strip (self , __chars : str | None = None ) -> str : ... # type: ignore[misc]
564
- @overload
565
- def swapcase (self : LiteralString ) -> LiteralString : ...
566
- @overload
567
498
def swapcase (self ) -> str : ... # type: ignore[misc]
568
- @overload
569
- def title (self : LiteralString ) -> LiteralString : ...
570
- @overload
571
499
def title (self ) -> str : ... # type: ignore[misc]
572
500
def translate (self , __table : _TranslateTable ) -> str : ...
573
- @overload
574
- def upper (self : LiteralString ) -> LiteralString : ...
575
- @overload
576
501
def upper (self ) -> str : ... # type: ignore[misc]
577
- @overload
578
- def zfill (self : LiteralString , __width : SupportsIndex ) -> LiteralString : ...
579
- @overload
580
502
def zfill (self , __width : SupportsIndex ) -> str : ... # type: ignore[misc]
581
503
@staticmethod
582
504
@overload
@@ -587,9 +509,6 @@ class str(Sequence[str]):
587
509
@staticmethod
588
510
@overload
589
511
def maketrans (__x : str , __y : str , __z : str ) -> dict [int , int | None ]: ...
590
- @overload
591
- def __add__ (self : LiteralString , __value : LiteralString ) -> LiteralString : ...
592
- @overload
593
512
def __add__ (self , __value : str ) -> str : ... # type: ignore[misc]
594
513
# Incompatible with Sequence.__contains__
595
514
def __contains__ (self , __key : str ) -> bool : ... # type: ignore[override]
@@ -598,25 +517,13 @@ class str(Sequence[str]):
598
517
def __getitem__ (self , __key : SupportsIndex | slice ) -> str : ...
599
518
def __gt__ (self , __value : str ) -> bool : ...
600
519
def __hash__ (self ) -> int : ...
601
- @overload
602
- def __iter__ (self : LiteralString ) -> Iterator [LiteralString ]: ...
603
- @overload
604
520
def __iter__ (self ) -> Iterator [str ]: ... # type: ignore[misc]
605
521
def __le__ (self , __value : str ) -> bool : ...
606
522
def __len__ (self ) -> int : ...
607
523
def __lt__ (self , __value : str ) -> bool : ...
608
- @overload
609
- def __mod__ (self : LiteralString , __value : LiteralString | tuple [LiteralString , ...]) -> LiteralString : ...
610
- @overload
611
524
def __mod__ (self , __value : Any ) -> str : ...
612
- @overload
613
- def __mul__ (self : LiteralString , __value : SupportsIndex ) -> LiteralString : ...
614
- @overload
615
525
def __mul__ (self , __value : SupportsIndex ) -> str : ... # type: ignore[misc]
616
526
def __ne__ (self , __value : object ) -> bool : ...
617
- @overload
618
- def __rmul__ (self : LiteralString , __value : SupportsIndex ) -> LiteralString : ...
619
- @overload
620
527
def __rmul__ (self , __value : SupportsIndex ) -> str : ... # type: ignore[misc]
621
528
def __getnewargs__ (self ) -> tuple [str ]: ...
622
529
0 commit comments