mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Harmonise return type of builtins.__import__ and importlib.import_module (#6302)
builtins.__import__ now returns ModuleType instead of Any. In addition, add __getattr__() to ModuleType to ease using imported modules.
This commit is contained in:
@@ -2,6 +2,7 @@ import types
|
||||
from importlib.abc import Loader
|
||||
from typing import Any, Mapping, Sequence
|
||||
|
||||
# `__import__` and `import_module` return type should be kept the same as `builtins.__import__`
|
||||
def __import__(
|
||||
name: str,
|
||||
globals: Mapping[str, Any] | None = ...,
|
||||
|
||||
Reference in New Issue
Block a user