Add stubs for importlib.machinery (#323)

* Fix some misspelled method names that were also missing 'self'

* Initial stubs for importlib.machinery

* Use importlib.machinery.ModuleSpec everywhere
This commit is contained in:
Brett Cannon
2016-06-30 17:07:49 -07:00
committed by Guido van Rossum
parent 05e02c188f
commit 43c3406770
4 changed files with 154 additions and 6 deletions

View File

@@ -4,6 +4,7 @@
# TODO parts of this should be conditional on version
import importlib.abc
from importlib._modulespec import ModuleSpec
import sys
from typing import (
Any, Callable, Dict, Generic, Iterator, Mapping, Optional, Tuple, TypeVar,
@@ -115,7 +116,7 @@ class ModuleType:
__package__ = ... # type: Optional[str]
# Should be Optional[ModuleSpec], but importlib.machinery has no stub
# yet.
__spec__ = ... # type: Optional[Any]
__spec__ = ... # type: Optional[ModuleSpec]
def __init__(self, name: str, doc: str) -> None: ...
class TracebackType: