mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Make sys.modules a Dict[str, Any] (#1266)
* Add __getattr__ to ModuleType.
Modules can contain anything, so give them a generic "__getattr__(name) -> Any".
This makes code like the following type-check, in pytype:
sys.modules.get("random").randint
* undo Python 3 change
* Revert "undo Python 3 change"
This reverts commit 96cf2d529e374a754f1ba681f0fc81aab25f81ef.
* Revert "Add __getattr__ to ModuleType."
This reverts commit 3ac1cf8a3b25dabfe386fbf34aef680fb1acd112.
* In stdlib/2/, make sys.modules a Dict[str, Any].
(Instead of Dict[str, ModuleType])
Same as stdlib/3/.
This commit is contained in:
committed by
Jelle Zijlstra
parent
d68d0c5c00
commit
8d8708594e
@@ -61,7 +61,7 @@ long_info = ... # type: object
|
||||
maxint = ... # type: int
|
||||
maxsize = ... # type: int
|
||||
maxunicode = ... # type: int
|
||||
modules = ... # type: Dict[str, ModuleType]
|
||||
modules = ... # type: Dict[str, Any]
|
||||
path = ... # type: List[str]
|
||||
platform = ... # type: str
|
||||
prefix = ... # type: str
|
||||
|
||||
Reference in New Issue
Block a user