Andrew Breza

22%
Flag icon
In some situations, it may be useful to hold a reference to an object that will not—by itself—keep an object alive. One example is a class that wants to keep track of all its current instances. This can be done with weak references, a low-level mechanism underlying the more useful collections WeakValueDictionary, WeakKeyDictionary, WeakSet, and the finalize function from the weakref module. For more on this, please see “Weak References” at fluentpython.com.
Fluent Python: Clear, Concise, and Effective Programming
Rate this book
Clear rating
Open Preview