Replace Mapping with types.MappingProxyType (#6013)

Mark `Signature.parameters` and `.return_annotation` as read-only properties
This commit is contained in:
Bas van Beek
2021-09-09 09:58:53 +02:00
committed by GitHub
parent 6188a3eec7
commit b9e1d7d522
5 changed files with 16 additions and 26 deletions

View File

@@ -1,7 +1,8 @@
import sys
import types
from abc import ABCMeta
from builtins import property as _builtins_property
from typing import Any, Iterator, Mapping, Type, TypeVar
from typing import Any, Iterator, Type, TypeVar
_T = TypeVar("_T")
_S = TypeVar("_S", bound=Type[Enum])
@@ -17,7 +18,7 @@ class EnumMeta(ABCMeta):
def __contains__(self: Type[Any], member: object) -> bool: ...
def __getitem__(self: Type[_T], name: str) -> _T: ...
@_builtins_property
def __members__(self: Type[_T]) -> Mapping[str, _T]: ...
def __members__(self: Type[_T]) -> types.MappingProxyType[str, _T]: ...
def __len__(self) -> int: ...
_member_names_: list[str] # undocumented
_member_map_: dict[str, Enum] # undocumented