diff --git a/stdlib/2/re.pyi b/stdlib/2/re.pyi index 8df3a4461..110e194af 100644 --- a/stdlib/2/re.pyi +++ b/stdlib/2/re.pyi @@ -97,3 +97,4 @@ def subn(pattern: Union[Pattern[str], Pattern[unicode]], repl: Callable[[Match[A def escape(string: AnyStr) -> AnyStr: ... def purge() -> None: ... +def template(pattern: Union[AnyStr, Pattern[AnyStr]], flags: int = ...) -> Pattern[AnyStr]: ... diff --git a/stdlib/3/re.pyi b/stdlib/3/re.pyi index 5bdd0833e..68a06f7b3 100644 --- a/stdlib/3/re.pyi +++ b/stdlib/3/re.pyi @@ -7,7 +7,7 @@ from typing import ( List, Iterator, overload, Callable, Tuple, Sequence, Dict, - Generic, AnyStr, Match, Pattern, Any, Optional + Generic, AnyStr, Match, Pattern, Any, Optional, Union ) # ----- re variables and constants ----- @@ -26,6 +26,8 @@ X = 0 VERBOSE = 0 U = 0 UNICODE = 0 +T = 0 +TEMPLATE = 0 class error(Exception): ... @@ -104,3 +106,4 @@ def subn(pattern: Pattern[AnyStr], repl: Callable[[Match[AnyStr]], AnyStr], def escape(string: AnyStr) -> AnyStr: ... def purge() -> None: ... +def template(pattern: Union[AnyStr, Pattern[AnyStr]], flags: int = ...) -> Pattern[AnyStr]: ...