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