June 2019
Beginner to intermediate
770 pages
19h 24m
English
The encoding function shouldn't expose information on the classes being converted into JSON. To keep each class properly encapsulated, it seems better to refactor the creation of a serialized representation into each application class. We'd rather not pile all of the encoding rules into a function outside the class definitions.
To do this with library classes, such as datetime, we would need to extend datetime.datetime for our application. This leads to making our application use the extended datetime instead of the datetime library. This can become a bit of a headache to avoid using the built-in datetime classes. Consequently, we may elect to strike a balance between our customized classes and library classes. ...
Read now
Unlock full access