Skip to content

Commit 603e649

Browse files
Gobot1234bbonenfant
authored andcommitted
Update __init__.py (danielgtaylor#451)
1 parent 25b2997 commit 603e649

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,
@@ -1182,7 +1183,7 @@ def to_dict(
11821183
output[cased_name] = value
11831184
return output
11841185

1185-
def from_dict(self: T, value: Dict[str, Any]) -> T:
1186+
def from_dict(self: T, value: Mapping[str, Any]) -> T:
11861187
"""
11871188
Parse the key/value pairs into the current message instance. This returns the
11881189
instance itself and is therefore assignable and chainable.
@@ -1385,7 +1386,7 @@ def to_pydict(
13851386
output[cased_name] = value
13861387
return output
13871388

1388-
def from_pydict(self: T, value: Dict[str, Any]) -> T:
1389+
def from_pydict(self: T, value: Mapping[str, Any]) -> T:
13891390
"""
13901391
Parse the key/value pairs into the current message instance. This returns the
13911392
instance itself and is therefore assignable and chainable.

0 commit comments

Comments
 (0)