From cedd1c848fa6ba174590cffa2981f55bbd929489 Mon Sep 17 00:00:00 2001 From: "Eric N. Vander Weele" Date: Thu, 17 Oct 2019 17:08:46 -0400 Subject: [PATCH] Revert __import__ function annotation to return type back to Any From python/mypy#7582. This partially reverts back the change in 0ee7c3c38b05a4d1712353bda5e6cffdaab2438b to have `__import__` return `Any` instead of `ModuleType`. --- stdlib/2/__builtin__.pyi | 4 ++-- stdlib/2and3/builtins.pyi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib/2/__builtin__.pyi b/stdlib/2/__builtin__.pyi index 0a39dae9f752..453cc040aefa 100644 --- a/stdlib/2/__builtin__.pyi +++ b/stdlib/2/__builtin__.pyi @@ -11,7 +11,7 @@ from typing import ( ) from abc import abstractmethod, ABCMeta from ast import mod, AST -from types import TracebackType, CodeType, ModuleType +from types import TracebackType, CodeType import sys if sys.version_info >= (3,): @@ -1455,7 +1455,7 @@ else: def __import__(name: Text, globals: Optional[Mapping[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ..., fromlist: Sequence[str] = ..., - level: int = ...) -> ModuleType: ... + level: int = ...) -> Any: ... # Actually the type of Ellipsis is , but since it's # not exposed anywhere under that name, we make it private here. diff --git a/stdlib/2and3/builtins.pyi b/stdlib/2and3/builtins.pyi index 0a39dae9f752..453cc040aefa 100644 --- a/stdlib/2and3/builtins.pyi +++ b/stdlib/2and3/builtins.pyi @@ -11,7 +11,7 @@ from typing import ( ) from abc import abstractmethod, ABCMeta from ast import mod, AST -from types import TracebackType, CodeType, ModuleType +from types import TracebackType, CodeType import sys if sys.version_info >= (3,): @@ -1455,7 +1455,7 @@ else: def __import__(name: Text, globals: Optional[Mapping[str, Any]] = ..., locals: Optional[Mapping[str, Any]] = ..., fromlist: Sequence[str] = ..., - level: int = ...) -> ModuleType: ... + level: int = ...) -> Any: ... # Actually the type of Ellipsis is , but since it's # not exposed anywhere under that name, we make it private here.