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