1
1
import sys
2
2
from _typeshed import SupportsKeysAndGetItem
3
+ from _typeshed .importlib import LoaderProtocol
3
4
from collections .abc import (
4
5
AsyncGenerator ,
5
6
Awaitable ,
@@ -16,7 +17,7 @@ from collections.abc import (
16
17
from importlib .machinery import ModuleSpec
17
18
18
19
# pytype crashes if types.MappingProxyType inherits from collections.abc.Mapping instead of typing.Mapping
19
- from typing import Any , ClassVar , Literal , Mapping , Protocol , TypeVar , final , overload # noqa: Y022
20
+ from typing import Any , ClassVar , Literal , Mapping , TypeVar , final , overload # noqa: Y022
20
21
from typing_extensions import ParamSpec , Self , TypeVarTuple , deprecated
21
22
22
23
__all__ = [
@@ -318,15 +319,12 @@ class SimpleNamespace:
318
319
def __setattr__ (self , name : str , value : Any , / ) -> None : ...
319
320
def __delattr__ (self , name : str , / ) -> None : ...
320
321
321
- class _LoaderProtocol (Protocol ):
322
- def load_module (self , fullname : str , / ) -> ModuleType : ...
323
-
324
322
class ModuleType :
325
323
__name__ : str
326
324
__file__ : str | None
327
325
@property
328
326
def __dict__ (self ) -> dict [str , Any ]: ... # type: ignore[override]
329
- __loader__ : _LoaderProtocol | None
327
+ __loader__ : LoaderProtocol | None
330
328
__package__ : str | None
331
329
__path__ : MutableSequence [str ]
332
330
__spec__ : ModuleSpec | None
0 commit comments