mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import enum
|
||||
import sys
|
||||
from sre_constants import error as error
|
||||
from typing import Any, AnyStr, Callable, Iterator, List, Optional, Tuple, Union, overload
|
||||
from typing import Any, AnyStr, Callable, Iterator, List, Tuple, Union, overload
|
||||
|
||||
# ----- re variables and constants -----
|
||||
if sys.version_info >= (3, 7):
|
||||
@@ -56,23 +56,23 @@ def compile(pattern: AnyStr, flags: _FlagsType = ...) -> Pattern[AnyStr]: ...
|
||||
@overload
|
||||
def compile(pattern: Pattern[AnyStr], flags: _FlagsType = ...) -> Pattern[AnyStr]: ...
|
||||
@overload
|
||||
def search(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ...
|
||||
def search(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Match[AnyStr] | None: ...
|
||||
@overload
|
||||
def search(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ...
|
||||
def search(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Match[AnyStr] | None: ...
|
||||
@overload
|
||||
def match(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ...
|
||||
def match(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Match[AnyStr] | None: ...
|
||||
@overload
|
||||
def match(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ...
|
||||
def match(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Match[AnyStr] | None: ...
|
||||
|
||||
# New in Python 3.4
|
||||
@overload
|
||||
def fullmatch(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ...
|
||||
def fullmatch(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> Match[AnyStr] | None: ...
|
||||
@overload
|
||||
def fullmatch(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Optional[Match[AnyStr]]: ...
|
||||
def fullmatch(pattern: Pattern[AnyStr], string: AnyStr, flags: _FlagsType = ...) -> Match[AnyStr] | None: ...
|
||||
@overload
|
||||
def split(pattern: AnyStr, string: AnyStr, maxsplit: int = ..., flags: _FlagsType = ...) -> List[Union[AnyStr, Any]]: ...
|
||||
def split(pattern: AnyStr, string: AnyStr, maxsplit: int = ..., flags: _FlagsType = ...) -> List[AnyStr | Any]: ...
|
||||
@overload
|
||||
def split(pattern: Pattern[AnyStr], string: AnyStr, maxsplit: int = ..., flags: _FlagsType = ...) -> List[Union[AnyStr, Any]]: ...
|
||||
def split(pattern: Pattern[AnyStr], string: AnyStr, maxsplit: int = ..., flags: _FlagsType = ...) -> List[AnyStr | Any]: ...
|
||||
@overload
|
||||
def findall(pattern: AnyStr, string: AnyStr, flags: _FlagsType = ...) -> List[Any]: ...
|
||||
@overload
|
||||
@@ -114,4 +114,4 @@ def subn(
|
||||
) -> Tuple[AnyStr, int]: ...
|
||||
def escape(pattern: AnyStr) -> AnyStr: ...
|
||||
def purge() -> None: ...
|
||||
def template(pattern: Union[AnyStr, Pattern[AnyStr]], flags: _FlagsType = ...) -> Pattern[AnyStr]: ...
|
||||
def template(pattern: AnyStr | Pattern[AnyStr], flags: _FlagsType = ...) -> Pattern[AnyStr]: ...
|
||||
|
||||
Reference in New Issue
Block a user