py39: add PEP 616 methods (#4090)

This commit is contained in:
Shantanu
2020-05-27 19:24:25 -07:00
committed by GitHub
parent 694fa80596
commit fd203e663e
3 changed files with 21 additions and 0 deletions

View File

@@ -473,6 +473,9 @@ class str(Sequence[str], _str_base):
@overload
def partition(self, __sep: unicode) -> Tuple[unicode, unicode, unicode]: ...
def replace(self, __old: AnyStr, __new: AnyStr, __count: int = ...) -> AnyStr: ...
if sys.version_info >= (3, 9):
def removeprefix(self, __prefix: str) -> str: ...
def removesuffix(self, __suffix: str) -> str: ...
def rfind(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ...
def rindex(self, sub: Text, __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ...
def rjust(self, __width: int, __fillchar: str = ...) -> str: ...
@@ -595,6 +598,9 @@ if sys.version_info >= (3,):
def lstrip(self, __bytes: Optional[bytes] = ...) -> bytes: ...
def partition(self, __sep: bytes) -> Tuple[bytes, bytes, bytes]: ...
def replace(self, __old: bytes, __new: bytes, __count: int = ...) -> bytes: ...
if sys.version_info >= (3, 9):
def removeprefix(self, __prefix: bytes) -> bytes: ...
def removesuffix(self, __suffix: bytes) -> bytes: ...
def rfind(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ...
def rindex(self, sub: Union[bytes, int], start: Optional[int] = ..., end: Optional[int] = ...) -> int: ...
def rjust(self, __width: int, __fillchar: bytes = ...) -> bytes: ...
@@ -708,6 +714,9 @@ class bytearray(MutableSequence[int], ByteString):
def lower(self) -> bytearray: ...
def lstrip(self, __bytes: Optional[bytes] = ...) -> bytearray: ...
def partition(self, __sep: bytes) -> Tuple[bytearray, bytearray, bytearray]: ...
if sys.version_info >= (3, 9):
def removeprefix(self, __prefix: bytes) -> bytearray: ...
def removesuffix(self, __suffix: bytes) -> bytearray: ...
def replace(self, __old: bytes, __new: bytes, __count: int = ...) -> bytearray: ...
if sys.version_info >= (3,):
def rfind(self, __sub: Union[bytes, int], __start: Optional[int] = ..., __end: Optional[int] = ...) -> int: ...