From 44b367c7fe7f01a175be00253507e79f567c2b9d Mon Sep 17 00:00:00 2001 From: Jakub Stasiak Date: Tue, 26 Jul 2016 15:43:29 +0100 Subject: [PATCH] Add re fullmatch() information (#381) --- stdlib/3/re.pyi | 8 +++++++- stdlib/3/typing.pyi | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/stdlib/3/re.pyi b/stdlib/3/re.pyi index 31e3cad01..5bdd0833e 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 + Generic, AnyStr, Match, Pattern, Any, Optional ) # ----- re variables and constants ----- @@ -44,6 +44,12 @@ def match(pattern: AnyStr, string: AnyStr, flags: int = ...) -> Match[AnyStr]: . @overload def match(pattern: Pattern[AnyStr], string: AnyStr, flags: int = ...) -> Match[AnyStr]: ... +# New in Python 3.4 +@overload +def fullmatch(pattern: AnyStr, string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ... +@overload +def fullmatch(pattern: Pattern[AnyStr], string: AnyStr, flags: int = ...) -> Optional[Match[AnyStr]]: ... + @overload def split(pattern: AnyStr, string: AnyStr, maxsplit: int = ..., flags: int = ...) -> List[AnyStr]: ... diff --git a/stdlib/3/typing.pyi b/stdlib/3/typing.pyi index 8fe18d358..69013f701 100644 --- a/stdlib/3/typing.pyi +++ b/stdlib/3/typing.pyi @@ -378,6 +378,9 @@ class Pattern(Generic[AnyStr]): endpos: int = ...) -> Match[AnyStr]: ... def match(self, string: AnyStr, pos: int = ..., endpos: int = ...) -> Match[AnyStr]: ... + # New in Python 3.4 + def fullmatch(self, string: AnyStr, pos: int = ..., + endpos: int = ...) -> Optional[Match[AnyStr]]: ... def split(self, string: AnyStr, maxsplit: int = ...) -> list[AnyStr]: ... def findall(self, string: AnyStr, pos: int = ..., endpos: int = ...) -> list[Any]: ...