technically it has to be a mapping, not specifically a dict
This commit is contained in:
parent
3cbebec9e7
commit
c6c56f3169
@ -18,6 +18,7 @@ from typing import (
|
||||
Iterable,
|
||||
List,
|
||||
Literal,
|
||||
Mapping,
|
||||
Optional,
|
||||
Sequence,
|
||||
Tuple,
|
||||
@ -523,7 +524,7 @@ def does_obj_satisfy_typed_dict(obj: Any, cls: GenericType) -> bool:
|
||||
Returns:
|
||||
Whether the object satisfies the typed dict.
|
||||
"""
|
||||
if not isinstance(obj, dict):
|
||||
if not isinstance(obj, Mapping):
|
||||
return False
|
||||
|
||||
key_names_to_values = get_type_hints(cls)
|
||||
|
Loading…
Reference in New Issue
Block a user