mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-01 00:53:23 +08:00
Fix return type of re.match, re.search (#1886)
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
from typing import (
|
||||
List, Iterator, overload, Callable, Tuple, Sequence, Dict,
|
||||
Generic, AnyStr, Match, Pattern, Any, Union
|
||||
Generic, AnyStr, Match, Pattern, Any, Optional, Union
|
||||
)
|
||||
|
||||
# ----- re variables and constants -----
|
||||
@@ -34,14 +34,14 @@ def compile(pattern: AnyStr, flags: int = ...) -> Pattern[AnyStr]: ...
|
||||
def compile(pattern: Pattern[AnyStr], flags: int = ...) -> Pattern[AnyStr]: ...
|
||||
|
||||
@overload
|
||||
def search(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Match[AnyStr]: ...
|
||||
def search(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ...
|
||||
@overload
|
||||
def search(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Match[AnyStr]: ...
|
||||
def search(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ...
|
||||
|
||||
@overload
|
||||
def match(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Match[AnyStr]: ...
|
||||
def match(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ...
|
||||
@overload
|
||||
def match(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Match[AnyStr]: ...
|
||||
def match(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ...
|
||||
|
||||
@overload
|
||||
def split(pattern: Union[str, unicode], string: AnyStr,
|
||||
|
||||
Reference in New Issue
Block a user