April 2014
Beginner to intermediate
634 pages
15h 22m
English
We can request that a shelf be opened with writeback=True. This will track changes to mutable objects by keeping a cached version of each object. Rather than burdening the shelve module with tracking all accessed objects to detect and preserve changes, the designs shown here will update a mutable object and specifically force the shelf to update the persistent version of the object.
This is a small shift in the runtime performance. An add_post() operation, for example, becomes slightly more costly because it also involves updating a Blog entry. If multiple Posts are added, these additional Blog updates become a kind of an overhead. However, this cost may be balanced by the improved performance of rendering ...