June 2019
Beginner to intermediate
770 pages
19h 24m
English
In order to properly support creating strings in JSON notation, we need encoders and decoders for classes outside the types that can be converted automatically. To encode our unique objects into JSON, we need to provide a function that will reduce our objects to Python primitive types. The json module calls this a default function; it provides a default encoding for an object of an unknown class.
To decode strings in JSON notation and create Python objects of an application class, a class outside the baseline types supported by JSON, we need to provide an extra function. This extra function will transform a dictionary of Python primitive values into an instance of the one of our application classes. This is ...
Read now
Unlock full access