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

2021-07-27 Thread Mark Gordon
Looks like a separate issue to me. That issue can be fixed by updating the Python implementation of WeakKeyDictioary. The fix for the WeakKeyDictionary issue I mentioned and the Ephemeron primitive (as Sebastian identified it) are equivalant (you can implement one from the other) and cannot be

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

2021-07-27 Thread Thomas Grainger
Would fixing this help? https://bugs.python.org/issue44140 On Tue, 20 Jul 2021, 02:16 Sebastian Berg, wrote: > 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

[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