def default(self, obj): if isinstance(obj, frozendict): return dict(obj) return json.JSONEncoder.default(self, obj)