[Python-ideas] Re: weakref.link: Keep A alive while B is alive (and/or update WeakKeyDictionary)

2021-07-19 Thread Sebastian Berg
On Mon, 2021-07-19 at 22:24 +, Mark Gordon wrote: > Proposal: > > Have a weakref.link (not at all attached to the naming) primitive > that allows one to keep object A alive while object B is alive. This > would be functionally similar to adding A as an attribute of B from > the GC's perspectiv

[Python-ideas] weakref.link: Keep A alive while B is alive (and/or update WeakKeyDictionary)

2021-07-19 Thread Mark Gordon
Proposal: Have a weakref.link (not at all attached to the naming) primitive that allows one to keep object A alive while object B is alive. This would be functionally similar to adding A as an attribute of B from the GC's perspective without making any assumptions about what attributes are avai