Update __init__.py (#451)

This commit is contained in:
James Hilton-Balfe 2023-03-08 08:20:56 +00:00 committed by GitHub
parent 2fa0be2141
commit e7f07fa2a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,7 @@ from typing import (
Generator, Generator,
Iterable, Iterable,
List, List,
Mapping,
Optional, Optional,
Set, Set,
Tuple, Tuple,
@ -1177,7 +1178,7 @@ class Message(ABC):
output[cased_name] = value output[cased_name] = value
return output return output
def from_dict(self: T, value: Dict[str, Any]) -> T: def from_dict(self: T, value: Mapping[str, Any]) -> T:
""" """
Parse the key/value pairs into the current message instance. This returns the Parse the key/value pairs into the current message instance. This returns the
instance itself and is therefore assignable and chainable. instance itself and is therefore assignable and chainable.
@ -1397,7 +1398,7 @@ class Message(ABC):
output[cased_name] = value output[cased_name] = value
return output return output
def from_pydict(self: T, value: Dict[str, Any]) -> T: def from_pydict(self: T, value: Mapping[str, Any]) -> T:
""" """
Parse the key/value pairs into the current message instance. This returns the Parse the key/value pairs into the current message instance. This returns the
instance itself and is therefore assignable and chainable. instance itself and is therefore assignable and chainable.