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