1 2 3 4 5 6
import json class JsonSerializable(object): def __repr__(self): return json.dumps(self.__dict__)