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