@@ -55,7 +55,7 @@ from typing import ( # noqa: Y027
55
55
overload ,
56
56
type_check_only ,
57
57
)
58
- from typing_extensions import Literal , LiteralString , SupportsIndex , TypeAlias , TypeGuard , final
58
+ from typing_extensions import Literal , SupportsIndex , TypeAlias , TypeGuard , final
59
59
60
60
if sys .version_info >= (3 , 9 ):
61
61
from types import GenericAlias
@@ -414,38 +414,20 @@ class str(Sequence[str]):
414
414
def __new__ (cls : type [Self ], object : object = ...) -> Self : ...
415
415
@overload
416
416
def __new__ (cls : type [Self ], object : ReadableBuffer , encoding : str = ..., errors : str = ...) -> Self : ...
417
- @overload
418
- def capitalize (self : LiteralString ) -> LiteralString : ...
419
- @overload
420
417
def capitalize (self ) -> str : ... # type: ignore[misc]
421
- @overload
422
- def casefold (self : LiteralString ) -> LiteralString : ...
423
- @overload
424
418
def casefold (self ) -> str : ... # type: ignore[misc]
425
- @overload
426
- def center (self : LiteralString , __width : SupportsIndex , __fillchar : LiteralString = ...) -> LiteralString : ...
427
- @overload
428
419
def center (self , __width : SupportsIndex , __fillchar : str = ...) -> str : ... # type: ignore[misc]
429
420
def count (self , x : str , __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...) -> int : ...
430
421
def encode (self , encoding : str = ..., errors : str = ...) -> bytes : ...
431
422
def endswith (
432
423
self , __suffix : str | tuple [str , ...], __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...
433
424
) -> bool : ...
434
425
if sys .version_info >= (3 , 8 ):
435
- @overload
436
- def expandtabs (self : LiteralString , tabsize : SupportsIndex = ...) -> LiteralString : ...
437
- @overload
438
426
def expandtabs (self , tabsize : SupportsIndex = ...) -> str : ... # type: ignore[misc]
439
427
else :
440
- @overload
441
- def expandtabs (self : LiteralString , tabsize : int = ...) -> LiteralString : ...
442
- @overload
443
428
def expandtabs (self , tabsize : int = ...) -> str : ... # type: ignore[misc]
444
429
445
430
def find (self , __sub : str , __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...) -> int : ...
446
- @overload
447
- def format (self : LiteralString , * args : LiteralString , ** kwargs : LiteralString ) -> LiteralString : ...
448
- @overload
449
431
def format (self , * args : object , ** kwargs : object ) -> str : ... # type: ignore[misc]
450
432
def format_map (self , map : _FormatMapMapping ) -> str : ...
451
433
def index (self , __sub : str , __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...) -> int : ...
@@ -461,127 +443,53 @@ class str(Sequence[str]):
461
443
def isspace (self ) -> bool : ...
462
444
def istitle (self ) -> bool : ...
463
445
def isupper (self ) -> bool : ...
464
- @overload
465
- def join (self : LiteralString , __iterable : Iterable [LiteralString ]) -> LiteralString : ...
466
- @overload
467
446
def join (self , __iterable : Iterable [str ]) -> str : ... # type: ignore[misc]
468
- @overload
469
- def ljust (self : LiteralString , __width : SupportsIndex , __fillchar : LiteralString = ...) -> LiteralString : ...
470
- @overload
471
447
def ljust (self , __width : SupportsIndex , __fillchar : str = ...) -> str : ... # type: ignore[misc]
472
- @overload
473
- def lower (self : LiteralString ) -> LiteralString : ...
474
- @overload
475
448
def lower (self ) -> str : ... # type: ignore[misc]
476
- @overload
477
- def lstrip (self : LiteralString , __chars : LiteralString | None = ...) -> LiteralString : ...
478
- @overload
479
449
def lstrip (self , __chars : str | None = ...) -> str : ... # type: ignore[misc]
480
- @overload
481
- def partition (self : LiteralString , __sep : LiteralString ) -> tuple [LiteralString , LiteralString , LiteralString ]: ...
482
- @overload
483
450
def partition (self , __sep : str ) -> tuple [str , str , str ]: ... # type: ignore[misc]
484
- @overload
485
- def replace (
486
- self : LiteralString , __old : LiteralString , __new : LiteralString , __count : SupportsIndex = ...
487
- ) -> LiteralString : ...
488
- @overload
489
451
def replace (self , __old : str , __new : str , __count : SupportsIndex = ...) -> str : ... # type: ignore[misc]
490
452
if sys .version_info >= (3 , 9 ):
491
- @overload
492
- def removeprefix (self : LiteralString , __prefix : LiteralString ) -> LiteralString : ...
493
- @overload
494
453
def removeprefix (self , __prefix : str ) -> str : ... # type: ignore[misc]
495
- @overload
496
- def removesuffix (self : LiteralString , __suffix : LiteralString ) -> LiteralString : ...
497
- @overload
498
454
def removesuffix (self , __suffix : str ) -> str : ... # type: ignore[misc]
499
455
500
456
def rfind (self , __sub : str , __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...) -> int : ...
501
457
def rindex (self , __sub : str , __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...) -> int : ...
502
- @overload
503
- def rjust (self : LiteralString , __width : SupportsIndex , __fillchar : LiteralString = ...) -> LiteralString : ...
504
- @overload
505
458
def rjust (self , __width : SupportsIndex , __fillchar : str = ...) -> str : ... # type: ignore[misc]
506
- @overload
507
- def rpartition (self : LiteralString , __sep : LiteralString ) -> tuple [LiteralString , LiteralString , LiteralString ]: ...
508
- @overload
509
459
def rpartition (self , __sep : str ) -> tuple [str , str , str ]: ... # type: ignore[misc]
510
- @overload
511
- def rsplit (self : LiteralString , sep : LiteralString | None = ..., maxsplit : SupportsIndex = ...) -> list [LiteralString ]: ...
512
- @overload
513
460
def rsplit (self , sep : str | None = ..., maxsplit : SupportsIndex = ...) -> list [str ]: ... # type: ignore[misc]
514
- @overload
515
- def rstrip (self : LiteralString , __chars : LiteralString | None = ...) -> LiteralString : ...
516
- @overload
517
461
def rstrip (self , __chars : str | None = ...) -> str : ... # type: ignore[misc]
518
- @overload
519
- def split (self : LiteralString , sep : LiteralString | None = ..., maxsplit : SupportsIndex = ...) -> list [LiteralString ]: ...
520
- @overload
521
462
def split (self , sep : str | None = ..., maxsplit : SupportsIndex = ...) -> list [str ]: ... # type: ignore[misc]
522
- @overload
523
- def splitlines (self : LiteralString , keepends : bool = ...) -> list [LiteralString ]: ...
524
- @overload
525
463
def splitlines (self , keepends : bool = ...) -> list [str ]: ... # type: ignore[misc]
526
464
def startswith (
527
465
self , __prefix : str | tuple [str , ...], __start : SupportsIndex | None = ..., __end : SupportsIndex | None = ...
528
466
) -> bool : ...
529
- @overload
530
- def strip (self : LiteralString , __chars : LiteralString | None = ...) -> LiteralString : ...
531
- @overload
532
467
def strip (self , __chars : str | None = ...) -> str : ... # type: ignore[misc]
533
- @overload
534
- def swapcase (self : LiteralString ) -> LiteralString : ...
535
- @overload
536
468
def swapcase (self ) -> str : ... # type: ignore[misc]
537
- @overload
538
- def title (self : LiteralString ) -> LiteralString : ...
539
- @overload
540
469
def title (self ) -> str : ... # type: ignore[misc]
541
470
def translate (self , __table : _TranslateTable ) -> str : ...
542
- @overload
543
- def upper (self : LiteralString ) -> LiteralString : ...
544
- @overload
545
471
def upper (self ) -> str : ... # type: ignore[misc]
546
- @overload
547
- def zfill (self : LiteralString , __width : SupportsIndex ) -> LiteralString : ...
548
- @overload
549
472
def zfill (self , __width : SupportsIndex ) -> str : ... # type: ignore[misc]
550
473
@staticmethod
551
474
@overload
552
475
def maketrans (__x : dict [int , _T ] | dict [str , _T ] | dict [str | int , _T ]) -> dict [int , _T ]: ...
553
476
@staticmethod
554
477
@overload
555
478
def maketrans (__x : str , __y : str , __z : str | None = ...) -> dict [int , int | None ]: ...
556
- @overload
557
- def __add__ (self : LiteralString , __s : LiteralString ) -> LiteralString : ...
558
- @overload
559
479
def __add__ (self , __s : str ) -> str : ... # type: ignore[misc]
560
480
# Incompatible with Sequence.__contains__
561
481
def __contains__ (self , __o : str ) -> bool : ... # type: ignore[override]
562
482
def __eq__ (self , __x : object ) -> bool : ...
563
483
def __ge__ (self , __x : str ) -> bool : ...
564
484
def __getitem__ (self , __i : SupportsIndex | slice ) -> str : ...
565
485
def __gt__ (self , __x : str ) -> bool : ...
566
- @overload
567
- def __iter__ (self : LiteralString ) -> Iterator [LiteralString ]: ...
568
- @overload
569
486
def __iter__ (self ) -> Iterator [str ]: ... # type: ignore[misc]
570
487
def __le__ (self , __x : str ) -> bool : ...
571
488
def __len__ (self ) -> int : ...
572
489
def __lt__ (self , __x : str ) -> bool : ...
573
- @overload
574
- def __mod__ (self : LiteralString , __x : LiteralString | tuple [LiteralString , ...]) -> LiteralString : ...
575
- @overload
576
490
def __mod__ (self , __x : Any ) -> str : ... # type: ignore[misc]
577
- @overload
578
- def __mul__ (self : LiteralString , __n : SupportsIndex ) -> LiteralString : ...
579
- @overload
580
491
def __mul__ (self , __n : SupportsIndex ) -> str : ... # type: ignore[misc]
581
492
def __ne__ (self , __x : object ) -> bool : ...
582
- @overload
583
- def __rmul__ (self : LiteralString , __n : SupportsIndex ) -> LiteralString : ...
584
- @overload
585
493
def __rmul__ (self , __n : SupportsIndex ) -> str : ... # type: ignore[misc]
586
494
def __getnewargs__ (self ) -> tuple [str ]: ...
587
495
0 commit comments