From e7f07fa2a113bcaef42571b4a67b3ddfbe0ab935 Mon Sep 17 00:00:00 2001 From: James Hilton-Balfe Date: Wed, 8 Mar 2023 08:20:56 +0000 Subject: [PATCH] Update __init__.py (#451) --- src/betterproto/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/betterproto/__init__.py b/src/betterproto/__init__.py index 172c62a..d1b0b99 100644 --- a/src/betterproto/__init__.py +++ b/src/betterproto/__init__.py @@ -25,6 +25,7 @@ from typing import ( Generator, Iterable, List, + Mapping, Optional, Set, Tuple, @@ -1177,7 +1178,7 @@ class Message(ABC): output[cased_name] = value 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 instance itself and is therefore assignable and chainable. @@ -1397,7 +1398,7 @@ class Message(ABC): output[cased_name] = value 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 instance itself and is therefore assignable and chainable.