Ryan Heisler <ryan.a.heis...@gmail.com> added the comment:
Perfect, thanks for your quick response. I was passing a bound method of obj as the func to `weakref.finalize(obj, func, /, *args, **kwargs)`. It slipped my mind that an instance variable like self.name and a bound method like self.clean_up, though they both belong to self, would be evaluated differently. For anyone wondering, I was looking for weakref.proxy (https://docs.python.org/3/library/weakref.html#weakref.proxy) or weakref.WeakMethod (https://docs.python.org/3/library/weakref.html#weakref.WeakMethod) ---------- resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue42945> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com