technically it has to be a mapping, not specifically a dict

This commit is contained in:
Khaleel Al-Adhami 2024-11-11 13:06:25 -08:00
parent 3cbebec9e7
commit c6c56f3169

View File

@ -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)