Skip to content

Commit 3ae1320

Browse files
Gobot1234bbonenfant
authored andcommitted
Update __init__.py (danielgtaylor#451)
1 parent 99222b7 commit 3ae1320

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/betterproto/__init__.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
Generator,
2626
Iterable,
2727
List,
28+
Mapping,
2829
Optional,
2930
Set,
3031
Tuple,
@@ -1177,7 +1178,7 @@ def to_dict(
11771178
output[cased_name] = value
11781179
return output
11791180

1180-
def from_dict(self: T, value: Dict[str, Any]) -> T:
1181+
def from_dict(self: T, value: Mapping[str, Any]) -> T:
11811182
"""
11821183
Parse the key/value pairs into the current message instance. This returns the
11831184
instance itself and is therefore assignable and chainable.
@@ -1397,7 +1398,7 @@ def to_pydict(
13971398
output[cased_name] = value
13981399
return output
13991400

1400-
def from_pydict(self: T, value: Dict[str, Any]) -> T:
1401+
def from_pydict(self: T, value: Mapping[str, Any]) -> T:
14011402
"""
14021403
Parse the key/value pairs into the current message instance. This returns the
14031404
instance itself and is therefore assignable and chainable.

0 commit comments

Comments
 (0)