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,4 +1,5 @@
import sys
import types
from datetime import datetime as _datetime
from email._header_value_parser import (
AddressList,
@@ -11,7 +12,7 @@ from email._header_value_parser import (
)
from email.errors import MessageDefect
from email.policy import Policy
from typing import Any, Iterable, Mapping, Tuple, Type
from typing import Any, Iterable, Tuple, Type
class BaseHeader(str):
@property
@@ -74,7 +75,7 @@ class MIMEVersionHeader:
class ParameterizedMIMEHeader:
@property
def params(self) -> Mapping[str, Any]: ...
def params(self) -> types.MappingProxyType[str, Any]: ...
@classmethod
def parse(cls, value: str, kwds: dict[str, Any]) -> None: ...