Python: find all instances of a class with gc.get_objects()

122 · Adamj · July 14, 2026, 8:22 p.m.
Summary
This post discusses a useful technique for debugging Python classes by utilizing the `gc.get_objects()` function to find live instances of a class, making it easier to analyze attributes or current states without altering the class itself.