¡@

Home 

python Programming Glossary: shadinginfoencoder

Overriding nested JSON encoding of inherited default supported objects like dict, list

http://stackoverflow.com/questions/16361223/overriding-nested-json-encoding-of-inherited-default-supported-objects-like-dict

are inherited from dict . I had tried stuff like class ShadingInfoEncoder json.JSONEncoder def encode self o if type o .__name__ NodeInfo.. o if type o .__name__ NodeInfo return ' _NodeInfo ' super ShadingInfoEncoder self .encode o ' ' elif type o .__name__ ShapeInfo return '.. type o .__name__ ShapeInfo return ' _ShapeInfo ' super ShadingInfoEncoder self .encode o ' ' elif type o .__name__ ShaderInfo return '..