|
6 | 6 | # and http://hg.python.org/cpython/file/618ea5612e83/Lib/re.py |
7 | 7 |
|
8 | 8 | from typing import ( |
9 | | - Undefined, List, Iterator, overload, Callable, Tuple, Sequence, Dict, |
| 9 | + Undefined, List, Iterator, Callable, Tuple, Sequence, Dict, Union, |
10 | 10 | Generic, AnyStr, Match, Pattern |
11 | 11 | ) |
12 | 12 |
|
@@ -46,20 +46,12 @@ def findall(pattern: AnyStr, string: AnyStr, |
46 | 46 | def finditer(pattern: AnyStr, string: AnyStr, |
47 | 47 | flags: int = 0) -> Iterator[Match[AnyStr]]: pass |
48 | 48 |
|
49 | | -@overload |
50 | | -def sub(pattern: AnyStr, repl: AnyStr, string: AnyStr, count: int = 0, |
51 | | - flags: int = 0) -> AnyStr: pass |
52 | | -@overload |
53 | | -def sub(pattern: AnyStr, repl: Callable[[Match[AnyStr]], AnyStr], |
| 49 | +def sub(pattern: AnyStr, repl: Union[AnyStr, Callable[[Match[AnyStr]], AnyStr]], |
54 | 50 | string: AnyStr, count: int = 0, flags: int = 0) -> AnyStr: pass |
55 | 51 |
|
56 | | -@overload |
57 | | -def subn(pattern: AnyStr, repl: AnyStr, string: AnyStr, count: int = 0, |
58 | | - flags: int = 0) -> Tuple[AnyStr, int]: pass |
59 | | -@overload |
60 | | -def subn(pattern: AnyStr, repl: Callable[[Match[AnyStr]], AnyStr], |
61 | | - string: AnyStr, count: int = 0, |
62 | | - flags: int = 0) -> Tuple[AnyStr, int]: pass |
| 52 | +def subn(pattern: AnyStr, repl: Union[AnyStr, Callable[[Match[AnyStr]], AnyStr]], |
| 53 | + string: AnyStr, count: int = 0, flags: int = 0) -> Tuple[AnyStr, int]: |
| 54 | + pass |
63 | 55 |
|
64 | 56 | def escape(string: AnyStr) -> AnyStr: pass |
65 | 57 |
|
|
0 commit comments