massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / coc-python-data / languageServer.0.5.59 / Typeshed / stdlib / 2 / re.pyi
1 # Stubs for re\r
2 # Ron Murawski <ron@horizonchess.com>\r
3 # 'bytes' support added by Jukka Lehtosalo\r
4 \r
5 # based on: http: //docs.python.org/2.7/library/re.html\r
6 \r
7 from typing import (\r
8     List, Iterator, overload, Callable, Tuple, Sequence, Dict,\r
9     Generic, AnyStr, Match, Pattern, Any, Optional, Union\r
10 )\r
11 \r
12 # ----- re variables and constants -----\r
13 DEBUG = 0\r
14 I = 0\r
15 IGNORECASE = 0\r
16 L = 0\r
17 LOCALE = 0\r
18 M = 0\r
19 MULTILINE = 0\r
20 S = 0\r
21 DOTALL = 0\r
22 X = 0\r
23 VERBOSE = 0\r
24 U = 0\r
25 UNICODE = 0\r
26 T = 0\r
27 TEMPLATE = 0\r
28 \r
29 class error(Exception): ...\r
30 \r
31 @overload\r
32 def compile(pattern: AnyStr, flags: int = ...) -> Pattern[AnyStr]: ...\r
33 @overload\r
34 def compile(pattern: Pattern[AnyStr], flags: int = ...) -> Pattern[AnyStr]: ...\r
35 \r
36 @overload\r
37 def search(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ...\r
38 @overload\r
39 def search(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ...\r
40 \r
41 @overload\r
42 def match(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ...\r
43 @overload\r
44 def match(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ...\r
45 \r
46 @overload\r
47 def split(pattern: Union[str, unicode], string: AnyStr,\r
48           maxsplit: int = ..., flags: int = ...) -> List[AnyStr]: ...\r
49 @overload\r
50 def split(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr,\r
51           maxsplit: int = ..., flags: int = ...) -> List[AnyStr]: ...\r
52 \r
53 @overload\r
54 def findall(pattern: Union[str, unicode], string: AnyStr, flags: int = ...) -> List[Any]: ...\r
55 @overload\r
56 def findall(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr, flags: int = ...) -> List[Any]: ...\r
57 \r
58 # Return an iterator yielding match objects over all non-overlapping matches\r
59 # for the RE pattern in string. The string is scanned left-to-right, and\r
60 # matches are returned in the order found. Empty matches are included in the\r
61 # result unless they touch the beginning of another match.\r
62 @overload\r
63 def finditer(pattern: Union[str, unicode], string: AnyStr,\r
64              flags: int = ...) -> Iterator[Match[AnyStr]]: ...\r
65 @overload\r
66 def finditer(pattern: Union[Pattern[str], Pattern[unicode]], string: AnyStr,\r
67              flags: int = ...) -> Iterator[Match[AnyStr]]: ...\r
68 \r
69 @overload\r
70 def sub(pattern: Union[str, unicode], repl: AnyStr, string: AnyStr, count: int = ...,\r
71         flags: int = ...) -> AnyStr: ...\r
72 @overload\r
73 def sub(pattern: Union[str, unicode], repl: Callable[[Match[AnyStr]], AnyStr],\r
74         string: AnyStr, count: int = ..., flags: int = ...) -> AnyStr: ...\r
75 @overload\r
76 def sub(pattern: Union[Pattern[str], Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ...,\r
77         flags: int = ...) -> AnyStr: ...\r
78 @overload\r
79 def sub(pattern: Union[Pattern[str], Pattern[unicode]], repl: Callable[[Match[AnyStr]], AnyStr],\r
80         string: AnyStr, count: int = ..., flags: int = ...) -> AnyStr: ...\r
81 \r
82 @overload\r
83 def subn(pattern: Union[str, unicode], repl: AnyStr, string: AnyStr, count: int = ...,\r
84          flags: int = ...) -> Tuple[AnyStr, int]: ...\r
85 @overload\r
86 def subn(pattern: Union[str, unicode], repl: Callable[[Match[AnyStr]], AnyStr],\r
87          string: AnyStr, count: int = ...,\r
88          flags: int = ...) -> Tuple[AnyStr, int]: ...\r
89 @overload\r
90 def subn(pattern: Union[Pattern[str], Pattern[unicode]], repl: AnyStr, string: AnyStr, count: int = ...,\r
91          flags: int = ...) -> Tuple[AnyStr, int]: ...\r
92 @overload\r
93 def subn(pattern: Union[Pattern[str], Pattern[unicode]], repl: Callable[[Match[AnyStr]], AnyStr],\r
94          string: AnyStr, count: int = ...,\r
95          flags: int = ...) -> Tuple[AnyStr, int]: ...\r
96 \r
97 def escape(string: AnyStr) -> AnyStr: ...\r
98 \r
99 def purge() -> None: ...\r
100 def template(pattern: Union[AnyStr, Pattern[AnyStr]], flags: int = ...) -> Pattern[AnyStr]: ...\r