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