mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Revert __import__ function annotation to return type back to Any (#3383)
From python/mypy#7582.
This partially reverts back the change in
0ee7c3c38b to have `__import__` return
`Any` instead of `ModuleType`.
This commit is contained in:
committed by
Sebastian Rittau
parent
fd7f1063d5
commit
966f8d24e6
@@ -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 <type 'ellipsis'>, but since it's
|
||||
# not exposed anywhere under that name, we make it private here.
|
||||
|
||||
@@ -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 <type 'ellipsis'>, but since it's
|
||||
# not exposed anywhere under that name, we make it private here.
|
||||
|
||||
Reference in New Issue
Block a user