diff --git a/stdlib/2/inspect.pyi b/stdlib/2/inspect.pyi index 8bc2eacb1..654fa0773 100644 --- a/stdlib/2/inspect.pyi +++ b/stdlib/2/inspect.pyi @@ -55,11 +55,11 @@ def ismemberdescriptor(object: object) -> bool: ... def findsource(object: object) -> Tuple[List[str], int]: ... def getabsfile(object: object) -> str: ... def getblock(lines: Sequence[str]) -> Sequence[str]: ... -def getdoc(object: object) -> str: ... -def getcomments(object: object) -> str: ... +def getdoc(object: object) -> Optional[str]: ... +def getcomments(object: object) -> Optional[str]: ... def getfile(object: object) -> str: ... -def getmodule(object: object) -> ModuleType: ... -def getsourcefile(object: object) -> str: ... +def getmodule(object: object) -> Optional[ModuleType]: ... +def getsourcefile(object: object) -> Optional[str]: ... # TODO restrict to "module, class, method, function, traceback, frame, # or code object" def getsourcelines(object: object) -> Tuple[List[str], int]: ... diff --git a/stdlib/3/inspect.pyi b/stdlib/3/inspect.pyi index 61737158e..320200c44 100644 --- a/stdlib/3/inspect.pyi +++ b/stdlib/3/inspect.pyi @@ -80,11 +80,11 @@ def ismemberdescriptor(object: object) -> bool: ... def findsource(object: object) -> Tuple[List[str], int]: ... def getabsfile(object: object) -> str: ... def getblock(lines: Sequence[str]) -> Sequence[str]: ... -def getdoc(object: object) -> str: ... -def getcomments(object: object) -> str: ... +def getdoc(object: object) -> Optional[str]: ... +def getcomments(object: object) -> Optional[str]: ... def getfile(object: object) -> str: ... -def getmodule(object: object) -> ModuleType: ... -def getsourcefile(object: object) -> str: ... +def getmodule(object: object) -> Optional[ModuleType]: ... +def getsourcefile(object: object) -> Optional[str]: ... # TODO restrict to "module, class, method, function, traceback, frame, # or code object" def getsourcelines(object: object) -> Tuple[List[str], int]: ...