mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
delete _importlib_modulespec (#5350)
* delete _importlib_modulespec * use typing_extensions.runtime_checkable
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
import sys
|
||||
import typing
|
||||
from importlib.abc import _LoaderProtocol
|
||||
from importlib.machinery import ModuleSpec
|
||||
from typing import Any, Awaitable, Callable, Dict, Generic, Iterable, Iterator, Mapping, Optional, Tuple, Type, TypeVar, overload
|
||||
from typing_extensions import Literal, final
|
||||
|
||||
# ModuleType is exported from this module, but for circular import
|
||||
# reasons exists in its own stub file (with ModuleSpec and Loader).
|
||||
from _importlib_modulespec import ModuleType as ModuleType # Exported
|
||||
|
||||
# Note, all classes "defined" here require special handling.
|
||||
|
||||
_T = TypeVar("_T")
|
||||
@@ -135,6 +133,15 @@ class SimpleNamespace:
|
||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||
def __delattr__(self, name: str) -> None: ...
|
||||
|
||||
class ModuleType:
|
||||
__name__: str
|
||||
__file__: str
|
||||
__dict__: Dict[str, Any]
|
||||
__loader__: Optional[_LoaderProtocol]
|
||||
__package__: Optional[str]
|
||||
__spec__: Optional[ModuleSpec]
|
||||
def __init__(self, name: str, doc: Optional[str] = ...) -> None: ...
|
||||
|
||||
class GeneratorType:
|
||||
gi_code: CodeType
|
||||
gi_frame: FrameType
|
||||
|
||||
Reference in New Issue
Block a user