mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Move some protocol definitions closer to their usage sites (#8436)
This commit is contained in:
@@ -13,11 +13,10 @@ from collections.abc import (
|
||||
MutableSequence,
|
||||
ValuesView,
|
||||
)
|
||||
from importlib.abc import _LoaderProtocol
|
||||
from importlib.machinery import ModuleSpec
|
||||
|
||||
# pytype crashes if types.MappingProxyType inherits from collections.abc.Mapping instead of typing.Mapping
|
||||
from typing import Any, ClassVar, Generic, Mapping, TypeVar, overload # noqa: Y027
|
||||
from typing import Any, ClassVar, Generic, Mapping, Protocol, TypeVar, overload # noqa: Y027
|
||||
from typing_extensions import Literal, ParamSpec, final
|
||||
|
||||
__all__ = [
|
||||
@@ -325,6 +324,9 @@ class SimpleNamespace:
|
||||
def __setattr__(self, __name: str, __value: Any) -> None: ...
|
||||
def __delattr__(self, __name: str) -> None: ...
|
||||
|
||||
class _LoaderProtocol(Protocol):
|
||||
def load_module(self, fullname: str) -> ModuleType: ...
|
||||
|
||||
class ModuleType:
|
||||
__name__: str
|
||||
__file__: str | None
|
||||
|
||||
Reference in New Issue
Block a user