Stop posting notifications to dead references.
When a reference is dead, the notification system skips it. It needs to be caught and removed from the system so that the looping is minimized. There is already a note about this in the code:
https://github.com/typesupply/defcon/blob/ufo3/Lib/defcon/tools/notifications.py#L190
Is this the reason for this documentation:
https://github.com/typesupply/defcon/blob/master/documentation/source/concepts/notifications.rst#dont-forget-removeobserver
Or is there any reason why you are not trusting the weakref module?
And what held you back from just deleting the entry?
Is this the reason for this documentation:
Yeah. At the time I thought that automatically removing dead references was too magical. I didn't want anyone to get into the habit of not removing observers under any circumstances. I've changed my mind on that. I think that bit of magic is okay.
Or is there any reason why you are not trusting the weakref module?
I'm not sure I follow. It looks like weakref is being used extensively. Early in defcon I think I didn't use weakref because some objects that I were dealing with couldn't be weakly referenced. (PyObjC wrapper objects, probably.) So, strong references were used. The PyObjC issue went away with better coding practice so I started using weakref. (Wow. This was around ten years ago!)
And what held you back from just deleting the entry?
Overthinking and being too strict. :)
Or is there any reason why you are not trusting the weakref module?
I'm not sure I follow. It looks like weakref is being used extensively.
I think weakref is fine; I was just speculating.