Allow tuple subclasses to be json serialized (#74207)

This commit is contained in:
J. Nick Koston
2022-06-29 19:14:56 -05:00
committed by GitHub
parent 1555f40bad
commit e2fe1a1c5d
2 changed files with 10 additions and 1 deletions

View File

@ -33,7 +33,7 @@ def json_encoder_default(obj: Any) -> Any:
Hand other objects to the original method.
"""
if isinstance(obj, set):
if isinstance(obj, (set, tuple)):
return list(obj)
if isinstance(obj, float):
return float(obj)