Python Developer — Hard
Key points
- `weakref.ref()` allows tracking objects without preventing their garbage collection.
- It is commonly used in observer patterns, caches, and mappings.
- The method returns the object or None if it has been collected.
- It is not a thread-safe reference or a copy-on-write reference.
Ready to go further?
Related questions
