mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-28 22:02:24 +08:00
Implement stubs for importlib.abc and update types.ModuleType (#321)
This commit is contained in:
committed by
Guido van Rossum
parent
3a01aeb562
commit
05e02c188f
@@ -3,6 +3,8 @@
|
||||
|
||||
# TODO parts of this should be conditional on version
|
||||
|
||||
import importlib.abc
|
||||
import sys
|
||||
from typing import (
|
||||
Any, Callable, Dict, Generic, Iterator, Mapping, Optional, Tuple, TypeVar,
|
||||
Union, overload
|
||||
@@ -107,8 +109,14 @@ BuiltinMethodType = BuiltinFunctionType
|
||||
|
||||
class ModuleType:
|
||||
__name__ = ... # type: str
|
||||
__file__ = ... # type: str
|
||||
def __init__(self, name: str, doc: Any) -> None: ...
|
||||
__doc__ = ... # type: Optional[str]
|
||||
if sys.version_info >= (3, 4):
|
||||
__loader__ = ... # type: Optional[importlib.abc.Loader]
|
||||
__package__ = ... # type: Optional[str]
|
||||
# Should be Optional[ModuleSpec], but importlib.machinery has no stub
|
||||
# yet.
|
||||
__spec__ = ... # type: Optional[Any]
|
||||
def __init__(self, name: str, doc: str) -> None: ...
|
||||
|
||||
class TracebackType:
|
||||
tb_frame = ... # type: FrameType
|
||||
|
||||
Reference in New Issue
Block a user