From 7f34bbcb888f462cfb7809ddf8fd48001874b39a Mon Sep 17 00:00:00 2001 From: Christopher Schramm Date: Thu, 5 Apr 2018 00:15:43 +0200 Subject: [PATCH] Add pkgutil.ModuleInfo (#2010) --- stdlib/2and3/pkgutil.pyi | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stdlib/2and3/pkgutil.pyi b/stdlib/2and3/pkgutil.pyi index 3f4903624..5d4ff1e54 100644 --- a/stdlib/2and3/pkgutil.pyi +++ b/stdlib/2and3/pkgutil.pyi @@ -1,6 +1,6 @@ # Stubs for pkgutil -from typing import Any, Callable, Generator, IO, Iterable, List, Optional, Tuple +from typing import Any, Callable, Generator, IO, Iterable, List, Optional, Tuple, NamedTuple import sys if sys.version_info >= (3,): @@ -8,7 +8,11 @@ if sys.version_info >= (3,): else: Loader = Any -_YMFNI = Generator[Tuple[Any, str, bool], None, None] +if sys.version_info >= (3, 6): + ModuleInfo = NamedTuple('ModuleInfo', [('module_finder', Any), ('name', str), ('ispkg', bool)]) + _YMFNI = Generator[ModuleInfo, None, None] +else: + _YMFNI = Generator[Tuple[Any, str, bool], None, None] def extend_path(path: Iterable[str], name: str) -> Iterable[str]: ...