From 4ea798b8693f8694b2159fd9079695059cbd09a7 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Tue, 23 May 2017 16:52:16 -0700 Subject: [PATCH] inspect.getmoduleinfo was removed in 3.6 (#1318) Compare https://docs.python.org/3.5/library/inspect.html#inspect.getmoduleinfo and https://docs.python.org/3.6/library/inspect.html --- stdlib/3/inspect.pyi | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/stdlib/3/inspect.pyi b/stdlib/3/inspect.pyi index ddf28b9e2..6b90ad951 100644 --- a/stdlib/3/inspect.pyi +++ b/stdlib/3/inspect.pyi @@ -1,5 +1,4 @@ -# Stubs for inspect - +import sys from typing import (AbstractSet, Any, Tuple, List, Dict, Callable, Generator, Mapping, MutableMapping, NamedTuple, Optional, Sequence, Union, ) @@ -8,15 +7,17 @@ from types import FrameType, ModuleType, TracebackType # # Types and members # -ModuleInfo = NamedTuple('ModuleInfo', [('name', str), - ('suffix', str), - ('mode', str), - ('module_type', int), - ]) +if sys.version_info < (3, 6): + ModuleInfo = NamedTuple('ModuleInfo', [('name', str), + ('suffix', str), + ('mode', str), + ('module_type', int), + ]) + def getmoduleinfo(path: str) -> Optional[ModuleInfo]: ... + def getmembers(object: object, predicate: Callable[[Any], bool] = ..., ) -> List[Tuple[str, Any]]: ... -def getmoduleinfo(path: str) -> Optional[ModuleInfo]: ... def getmodulename(path: str) -> Optional[str]: ... def ismodule(object: object) -> bool: ...