I have a project where i\'m trying to use weakrefs with callbacks, and I don\'t understand what I\'m doing wrong. I have created simplified test that shows the exact behavio
You want a WeakMethod.
An explanation why your solution doesn't work can be found in the discussion of the recipe:
Normal weakref.refs to bound methods don't quite work the way one expects, because bound methods are first-class objects; weakrefs to bound methods are dead-on-arrival unless some other strong reference to the same bound method exists.