Skip to content

Commit 7075e5e

Browse files
committed
Avoid duplication for LoaderProtocol
1 parent 45b7a5c commit 7075e5e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

stdlib/types.pyi

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import sys
22
from _typeshed import SupportsKeysAndGetItem
3+
from _typeshed.importlib import LoaderProtocol
34
from collections.abc import (
45
AsyncGenerator,
56
Awaitable,
@@ -16,7 +17,7 @@ from collections.abc import (
1617
from importlib.machinery import ModuleSpec
1718

1819
# 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
2021
from typing_extensions import ParamSpec, Self, TypeVarTuple, deprecated
2122

2223
__all__ = [
@@ -318,15 +319,12 @@ class SimpleNamespace:
318319
def __setattr__(self, name: str, value: Any, /) -> None: ...
319320
def __delattr__(self, name: str, /) -> None: ...
320321

321-
class _LoaderProtocol(Protocol):
322-
def load_module(self, fullname: str, /) -> ModuleType: ...
323-
324322
class ModuleType:
325323
__name__: str
326324
__file__: str | None
327325
@property
328326
def __dict__(self) -> dict[str, Any]: ... # type: ignore[override]
329-
__loader__: _LoaderProtocol | None
327+
__loader__: LoaderProtocol | None
330328
__package__: str | None
331329
__path__: MutableSequence[str]
332330
__spec__: ModuleSpec | None

0 commit comments

Comments
 (0)