diff --git a/builtins/2.7/_sre.pyi b/builtins/2.7/_sre.pyi index 7b34bf404..01561576c 100644 --- a/builtins/2.7/_sre.pyi +++ b/builtins/2.7/_sre.pyi @@ -1,53 +1,53 @@ """Stub file for the '_sre' module.""" -# This is an autogenerated file. It serves as a starting point -# for a more precise manual annotation of this module. -# Feel free to edit the source below, but remove this header when you do. -from typing import Any, List, Tuple, Dict, Generic +from typing import Any, Optional, Mapping, Sequence, Dict, List, Tuple, overload CODESIZE = ... # type: int MAGIC = ... # type: int MAXREPEAT = ... # type: long copyright = ... # type: str -def compile(a, b: int, c, *args, **kwargs) -> SRE_Pattern: +class SRE_Match(object): + def start(self, group: int = ...) -> int: + raise IndexError() + def end(self, group: int = ...) -> int: + raise IndexError() + def expand(self, s: str) -> Any: ... + @overload + def group(self) -> str: ... + @overload + def group(self, group:int = ...) -> Optional[str]: ... + def groupdict(self) -> Dict[int, Optional[str]]: ... + def groups(self) -> Tuple[Optional[str]]: ... + def span(self) -> Tuple[int, int]: + raise IndexError() + +class SRE_Scanner(object): + pattern = ... # type: str + def match(self) -> SRE_Match: ... + def search(self) -> SRE_Match: ... + +class SRE_Pattern(object): + pattern = ... # type: str + flags = ... # type: int + groups = ... # type: int + groupindex = ... # type: Mapping[int, int] + indexgroup = ... # type: Sequence[int] + def findall(self, source: str, pos:int = ..., endpos:int = ...) -> List[Union[tuple, str]]: ... + def finditer(self, source: str, pos: int = ..., endpos:int = ...) -> Iterable[Union[tuple, str]]: ... + def match(self, pattern, pos: int = ..., endpos:int = ...) -> SRE_Match: ... + def scanner(self, s: str, start: int = ..., end: int = ...) -> SRE_Scanner: ... + def search(self, pattern, pos: int = ..., endpos: int = ...) -> SRE_Match: ... + def split(self, source: str, maxsplit:int = ...) -> List[Optional[str]]: ... + def sub(self, repl: str, string: str, count:int = ...) -> tuple: ... + def subn(self, repl: str, string: str, count:int = ...) -> tuple: ... + +def compile(pattern: str, flags: int, code: List[int], + groups:int = ..., + groupindex: Mapping[int, int] = ..., + indexgroup: Sequence[int] = ...) -> SRE_Pattern: raise OverflowError() def getcodesize() -> int: ... def getlower(a: int, b: int) -> int: ... - - -class SRE_Match(object): - def __copy__(self) -> Any: - raise TypeError() - def __deepcopy__(self, *args, **kwargs) -> Any: - raise TypeError() - def end(self, *args, **kwargs) -> int: - raise IndexError() - def expand(self, *args, **kwargs) -> Any: ... - def group(self, *args, **kwargs) -> tuple: ... - def groupdict(self, *args, **kwargs) -> dict: ... - def groups(self, *args, **kwargs) -> tuple: ... - def span(self, *args, **kwargs) -> tuple: - raise IndexError() - def start(self, *args, **kwargs) -> int: - raise IndexError() - -class SRE_Pattern(object): - def __copy__(self) -> Any: - raise TypeError() - def __deepcopy__(self, *args, **kwargs) -> Any: - raise TypeError() - def findall(self, source, *args, **kwargs) -> List[tuple]: ... - def finditer(self, *args, **kwargs) -> callable_iterator: ... - def match(self, pattern, *args, **kwargs) -> Any: ... - def scanner(self, a, *args, **kwargs) -> SRE_Scanner: ... - def search(self, pattern, *args, **kwargs) -> Any: ... - def split(self, source, *args, **kwargs) -> List[None]: ... - def sub(self, repl, string, *args, **kwargs) -> tuple: ... - def subn(self, repl, string, *args, **kwargs) -> tuple: ... - -class SRE_Scanner(object): - def match(self) -> Any: ... - def search(self) -> Any: ...