Use PEP 570 syntax in third party stubs (#11554)

This commit is contained in:
Shantanu
2024-03-10 06:11:43 -07:00
committed by GitHub
parent f94bbfbcc4
commit 88fa182253
97 changed files with 625 additions and 632 deletions

View File

@@ -593,11 +593,11 @@ class Match(Generic[AnyStr]):
@property
def fuzzy_changes(self) -> tuple[list[int], list[int], list[int]]: ...
@overload
def group(self, __group: Literal[0] = 0) -> AnyStr: ...
def group(self, group: Literal[0] = 0, /) -> AnyStr: ...
@overload
def group(self, __group: int | str = ...) -> AnyStr | Any: ...
def group(self, group: int | str = ..., /) -> AnyStr | Any: ...
@overload
def group(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[AnyStr | Any, ...]: ...
def group(self, group1: int | str, group2: int | str, /, *groups: int | str) -> tuple[AnyStr | Any, ...]: ...
@overload
def groups(self, default: None = None) -> tuple[AnyStr | Any, ...]: ...
@overload
@@ -607,43 +607,43 @@ class Match(Generic[AnyStr]):
@overload
def groupdict(self, default: _T) -> dict[str, AnyStr | _T]: ...
@overload
def span(self, __group: int | str = ...) -> tuple[int, int]: ...
def span(self, group: int | str = ..., /) -> tuple[int, int]: ...
@overload
def span(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[tuple[int, int], ...]: ...
def span(self, group1: int | str, group2: int | str, /, *groups: int | str) -> tuple[tuple[int, int], ...]: ...
@overload
def spans(self, __group: int | str = ...) -> list[tuple[int, int]]: ...
def spans(self, group: int | str = ..., /) -> list[tuple[int, int]]: ...
@overload
def spans(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[list[tuple[int, int]], ...]: ...
def spans(self, group1: int | str, group2: int | str, /, *groups: int | str) -> tuple[list[tuple[int, int]], ...]: ...
@overload
def start(self, __group: int | str = ...) -> int: ...
def start(self, group: int | str = ..., /) -> int: ...
@overload
def start(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[int, ...]: ...
def start(self, group1: int | str, group2: int | str, /, *groups: int | str) -> tuple[int, ...]: ...
@overload
def starts(self, __group: int | str = ...) -> list[int]: ...
def starts(self, group: int | str = ..., /) -> list[int]: ...
@overload
def starts(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[list[int], ...]: ...
def starts(self, group1: int | str, group2: int | str, /, *groups: int | str) -> tuple[list[int], ...]: ...
@overload
def end(self, __group: int | str = ...) -> int: ...
def end(self, group: int | str = ..., /) -> int: ...
@overload
def end(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[int, ...]: ...
def end(self, group1: int | str, group2: int | str, /, *groups: int | str) -> tuple[int, ...]: ...
@overload
def ends(self, __group: int | str = ...) -> list[int]: ...
def ends(self, group: int | str = ..., /) -> list[int]: ...
@overload
def ends(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[list[int], ...]: ...
def ends(self, group1: int | str, group2: int | str, /, *groups: int | str) -> tuple[list[int], ...]: ...
def expand(self, template: AnyStr) -> AnyStr: ...
def expandf(self, format: AnyStr) -> AnyStr: ...
@overload
def captures(self, __group: int | str = ...) -> list[AnyStr]: ...
def captures(self, group: int | str = ..., /) -> list[AnyStr]: ...
@overload
def captures(self, __group1: int | str, __group2: int | str, *groups: int | str) -> tuple[list[AnyStr], ...]: ...
def captures(self, group1: int | str, group2: int | str, /, *groups: int | str) -> tuple[list[AnyStr], ...]: ...
def capturesdict(self) -> dict[str, list[AnyStr]]: ...
def detach_string(self) -> None: ...
def allcaptures(self) -> tuple[list[AnyStr]]: ...
def allspans(self) -> tuple[list[tuple[int, int]]]: ...
@overload
def __getitem__(self, __key: Literal[0]) -> AnyStr: ...
def __getitem__(self, key: Literal[0], /) -> AnyStr: ...
@overload
def __getitem__(self, __key: int | str) -> AnyStr | Any: ...
def __getitem__(self, key: int | str, /) -> AnyStr | Any: ...
def __copy__(self) -> Self: ...
def __deepcopy__(self) -> Self: ...
if sys.version_info >= (3, 9):