◐ Shell
clean mode source ↗

Message 189120 - Python tracker

> The second one is when the class is being deleted, for housekeeping
> of the weakrefs.
> I worry that your alternative will cause us to walk the entire list
> in the second case because it will be called when the weakref has
> been cleared, so  it will never find itself in the list, only None.

I don't think that matters much. In both cases the expected complexity
is O(n).