mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Use PEP 585 syntax in Python 2, protobuf & _ast stubs, where possible (#6949)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import Any, AnyStr, Callable, Iterator, List, Match, Pattern, Tuple, overload
|
||||
from typing import Any, AnyStr, Callable, Iterator, Match, Pattern, overload
|
||||
|
||||
# ----- re variables and constants -----
|
||||
DEBUG: int
|
||||
@@ -32,13 +32,13 @@ def match(pattern: str | unicode, string: AnyStr, flags: int = ...) -> Match[Any
|
||||
@overload
|
||||
def match(pattern: Pattern[str] | Pattern[unicode], string: AnyStr, flags: int = ...) -> Match[AnyStr] | None: ...
|
||||
@overload
|
||||
def split(pattern: str | unicode, string: AnyStr, maxsplit: int = ..., flags: int = ...) -> List[AnyStr]: ...
|
||||
def split(pattern: str | unicode, string: AnyStr, maxsplit: int = ..., flags: int = ...) -> list[AnyStr]: ...
|
||||
@overload
|
||||
def split(pattern: Pattern[str] | Pattern[unicode], string: AnyStr, maxsplit: int = ..., flags: int = ...) -> List[AnyStr]: ...
|
||||
def split(pattern: Pattern[str] | Pattern[unicode], string: AnyStr, maxsplit: int = ..., flags: int = ...) -> list[AnyStr]: ...
|
||||
@overload
|
||||
def findall(pattern: str | unicode, string: AnyStr, flags: int = ...) -> List[Any]: ...
|
||||
def findall(pattern: str | unicode, string: AnyStr, flags: int = ...) -> list[Any]: ...
|
||||
@overload
|
||||
def findall(pattern: Pattern[str] | Pattern[unicode], string: AnyStr, flags: int = ...) -> List[Any]: ...
|
||||
def findall(pattern: Pattern[str] | Pattern[unicode], string: AnyStr, flags: int = ...) -> list[Any]: ...
|
||||
|
||||
# Return an iterator yielding match objects over all non-overlapping matches
|
||||
# for the RE pattern in string. The string is scanned left-to-right, and
|
||||
@@ -65,15 +65,15 @@ def sub(
|
||||
flags: int = ...,
|
||||
) -> AnyStr: ...
|
||||
@overload
|
||||
def subn(pattern: str | unicode, repl: AnyStr, string: AnyStr, count: int = ..., flags: int = ...) -> Tuple[AnyStr, int]: ...
|
||||
def subn(pattern: str | unicode, repl: AnyStr, string: AnyStr, count: int = ..., flags: int = ...) -> tuple[AnyStr, int]: ...
|
||||
@overload
|
||||
def subn(
|
||||
pattern: str | unicode, repl: Callable[[Match[AnyStr]], AnyStr], string: AnyStr, count: int = ..., flags: int = ...
|
||||
) -> Tuple[AnyStr, int]: ...
|
||||
) -> tuple[AnyStr, int]: ...
|
||||
@overload
|
||||
def subn(
|
||||
pattern: Pattern[str] | Pattern[unicode], repl: AnyStr, string: AnyStr, count: int = ..., flags: int = ...
|
||||
) -> Tuple[AnyStr, int]: ...
|
||||
) -> tuple[AnyStr, int]: ...
|
||||
@overload
|
||||
def subn(
|
||||
pattern: Pattern[str] | Pattern[unicode],
|
||||
@@ -81,7 +81,7 @@ def subn(
|
||||
string: AnyStr,
|
||||
count: int = ...,
|
||||
flags: int = ...,
|
||||
) -> Tuple[AnyStr, int]: ...
|
||||
) -> tuple[AnyStr, int]: ...
|
||||
def escape(string: AnyStr) -> AnyStr: ...
|
||||
def purge() -> None: ...
|
||||
def template(pattern: AnyStr | Pattern[AnyStr], flags: int = ...) -> Pattern[AnyStr]: ...
|
||||
|
||||
Reference in New Issue
Block a user