From 89f27742cab2ba6a8e92b2432dc2fefda7b7d9f2 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Wed, 24 May 2017 14:07:31 -0700 Subject: [PATCH] add re.template (#1330) --- stdlib/2/re.pyi | 1 + stdlib/3/re.pyi | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) 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]: ...