@@ -56,7 +56,6 @@ from typing import ( # noqa: Y022
56
56
from typing_extensions import ( # type: ignore
57
57
Concatenate ,
58
58
Literal ,
59
- LiteralString ,
60
59
ParamSpec ,
61
60
Self ,
62
61
SupportsIndex ,
@@ -433,38 +432,20 @@ class str(Sequence[str]):
433
432
def __new__ (cls , object : object = ...) -> Self : ...
434
433
@overload
435
434
def __new__ (cls , object : ReadableBuffer , encoding : str = ..., errors : str = ...) -> Self : ...
436
- @overload
437
- def capitalize (self : LiteralString ) -> LiteralString : ...
438
- @overload
439
435
def capitalize (self ) -> str : ... # type: ignore[misc]
440
- @overload
441
- def casefold (self : LiteralString ) -> LiteralString : ...
442
- @overload
443
436
def casefold (self ) -> str : ... # type: ignore[misc]
444
- @overload
445
- def center (self : LiteralString , __width : SupportsIndex , __fillchar : LiteralString = " " ) -> LiteralString : ...
446
- @overload
447
437
def center (self , __width : SupportsIndex , __fillchar : str = " " ) -> str : ... # type: ignore[misc]
448
438
def count (self , x : str , __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...) -> int : ...
449
439
def encode (self , encoding : str = "utf-8" , errors : str = "strict" ) -> bytes : ...
450
440
def endswith (
451
441
self , __suffix : str | tuple [str , ...], __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...
452
442
) -> bool : ...
453
443
if sys .version_info >= (3 , 8 ):
454
- @overload
455
- def expandtabs (self : LiteralString , tabsize : SupportsIndex = 8 ) -> LiteralString : ...
456
- @overload
457
444
def expandtabs (self , tabsize : SupportsIndex = 8 ) -> str : ... # type: ignore[misc]
458
445
else :
459
- @overload
460
- def expandtabs (self : LiteralString , tabsize : int = 8 ) -> LiteralString : ...
461
- @overload
462
446
def expandtabs (self , tabsize : int = 8 ) -> str : ... # type: ignore[misc]
463
447
464
448
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
449
def format (self , * args : object , ** kwargs : object ) -> str : ... # type: ignore
469
450
def format_map (self , map : _FormatMapMapping ) -> str : ...
470
451
def index (self , __sub : str , __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...) -> int : ...
@@ -480,91 +461,32 @@ class str(Sequence[str]):
480
461
def isspace (self ) -> bool : ...
481
462
def istitle (self ) -> bool : ...
482
463
def isupper (self ) -> bool : ...
483
- @overload
484
- def join (self : LiteralString , __iterable : Iterable [LiteralString ]) -> LiteralString : ...
485
- @overload
486
464
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
465
def ljust (self , __width : SupportsIndex , __fillchar : str = " " ) -> str : ... # type: ignore[misc]
491
- @overload
492
- def lower (self : LiteralString ) -> LiteralString : ...
493
- @overload
494
466
def lower (self ) -> str : ... # type: ignore[misc]
495
- @overload
496
- def lstrip (self : LiteralString , __chars : LiteralString | None = None ) -> LiteralString : ...
497
- @overload
498
467
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
468
def partition (self , __sep : str ) -> tuple [str , str , str ]: ... # type: ignore[misc]
503
- @overload
504
- def replace (
505
- self : LiteralString , __old : LiteralString , __new : LiteralString , __count : SupportsIndex = - 1
506
- ) -> LiteralString : ...
507
- @overload
508
469
def replace (self , __old : str , __new : str , __count : SupportsIndex = - 1 ) -> str : ... # type: ignore[misc]
509
470
if sys .version_info >= (3 , 9 ):
510
- @overload
511
- def removeprefix (self : LiteralString , __prefix : LiteralString ) -> LiteralString : ...
512
- @overload
513
471
def removeprefix (self , __prefix : str ) -> str : ... # type: ignore[misc]
514
- @overload
515
- def removesuffix (self : LiteralString , __suffix : LiteralString ) -> LiteralString : ...
516
- @overload
517
472
def removesuffix (self , __suffix : str ) -> str : ... # type: ignore[misc]
518
473
519
474
def rfind (self , __sub : str , __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...) -> int : ...
520
475
def rindex (self , __sub : str , __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...) -> int : ...
521
- @overload
522
- def rjust (self : LiteralString , __width : SupportsIndex , __fillchar : LiteralString = " " ) -> LiteralString : ...
523
- @overload
524
476
def rjust (self , __width : SupportsIndex , __fillchar : str = " " ) -> str : ... # type: ignore[misc]
525
- @overload
526
- def rpartition (self : LiteralString , __sep : LiteralString ) -> tuple [LiteralString , LiteralString , LiteralString ]: ...
527
- @overload
528
477
def rpartition (self , __sep : str ) -> tuple [str , str , str ]: ... # type: ignore[misc]
529
- @overload
530
- def rsplit (self : LiteralString , sep : LiteralString | None = None , maxsplit : SupportsIndex = - 1 ) -> list [LiteralString ]: ...
531
- @overload
532
478
def rsplit (self , sep : str | None = None , maxsplit : SupportsIndex = - 1 ) -> list [str ]: ... # type: ignore[misc]
533
- @overload
534
- def rstrip (self : LiteralString , __chars : LiteralString | None = None ) -> LiteralString : ...
535
- @overload
536
479
def rstrip (self , __chars : str | None = None ) -> str : ... # type: ignore[misc]
537
- @overload
538
- def split (self : LiteralString , sep : LiteralString | None = None , maxsplit : SupportsIndex = - 1 ) -> list [LiteralString ]: ...
539
- @overload
540
480
def split (self , sep : str | None = None , maxsplit : SupportsIndex = - 1 ) -> list [str ]: ... # type: ignore[misc]
541
- @overload
542
- def splitlines (self : LiteralString , keepends : bool = False ) -> list [LiteralString ]: ...
543
- @overload
544
481
def splitlines (self , keepends : bool = False ) -> list [str ]: ... # type: ignore[misc]
545
482
def startswith (
546
483
self , __prefix : str | tuple [str , ...], __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...
547
484
) -> bool : ...
548
- @overload
549
- def strip (self : LiteralString , __chars : LiteralString | None = None ) -> LiteralString : ...
550
- @overload
551
485
def strip (self , __chars : str | None = None ) -> str : ... # type: ignore[misc]
552
- @overload
553
- def swapcase (self : LiteralString ) -> LiteralString : ...
554
- @overload
555
486
def swapcase (self ) -> str : ... # type: ignore[misc]
556
- @overload
557
- def title (self : LiteralString ) -> LiteralString : ...
558
- @overload
559
487
def title (self ) -> str : ... # type: ignore[misc]
560
488
def translate (self , __table : _TranslateTable ) -> str : ...
561
- @overload
562
- def upper (self : LiteralString ) -> LiteralString : ...
563
- @overload
564
489
def upper (self ) -> str : ... # type: ignore[misc]
565
- @overload
566
- def zfill (self : LiteralString , __width : SupportsIndex ) -> LiteralString : ...
567
- @overload
568
490
def zfill (self , __width : SupportsIndex ) -> str : ... # type: ignore[misc]
569
491
@staticmethod
570
492
@overload
@@ -575,35 +497,20 @@ class str(Sequence[str]):
575
497
@staticmethod
576
498
@overload
577
499
def maketrans (__x : str , __y : str , __z : str ) -> dict [int , int | None ]: ...
578
- @overload
579
- def __add__ (self : LiteralString , __value : LiteralString ) -> LiteralString : ...
580
- @overload
581
500
def __add__ (self , __value : str ) -> str : ... # type: ignore[misc]
582
501
# Incompatible with Sequence.__contains__
583
502
def __contains__ (self , __key : str ) -> bool : ... # type: ignore[override]
584
503
def __eq__ (self , __value : object ) -> bool : ...
585
504
def __ge__ (self , __value : str ) -> bool : ...
586
505
def __getitem__ (self , __key : SupportsIndex | slice ) -> str : ...
587
506
def __gt__ (self , __value : str ) -> bool : ...
588
- @overload
589
- def __iter__ (self : LiteralString ) -> Iterator [LiteralString ]: ...
590
- @overload
591
507
def __iter__ (self ) -> Iterator [str ]: ... # type: ignore[misc]
592
508
def __le__ (self , __value : str ) -> bool : ...
593
509
def __len__ (self ) -> int : ...
594
510
def __lt__ (self , __value : str ) -> bool : ...
595
- @overload
596
- def __mod__ (self : LiteralString , __value : LiteralString | tuple [LiteralString , ...]) -> LiteralString : ...
597
- @overload
598
511
def __mod__ (self , __value : Any ) -> str : ... # type: ignore
599
- @overload
600
- def __mul__ (self : LiteralString , __value : SupportsIndex ) -> LiteralString : ...
601
- @overload
602
512
def __mul__ (self , __value : SupportsIndex ) -> str : ... # type: ignore[misc]
603
513
def __ne__ (self , __value : object ) -> bool : ...
604
- @overload
605
- def __rmul__ (self : LiteralString , __value : SupportsIndex ) -> LiteralString : ...
606
- @overload
607
514
def __rmul__ (self , __value : SupportsIndex ) -> str : ... # type: ignore[misc]
608
515
def __getnewargs__ (self ) -> tuple [str ]: ...
609
516
0 commit comments