Skip to content
UPEEC

gc and weakref

Control the garbage collector, and hold references that don't keep objects alive.

Advanced
Comments 0

weakref.WeakValueDictionary makes caches that let unused objects be freed; gc.collect() forces a cycle collection.

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.