RFC: Proposal: Deterministic Object Destruction (Posting On Python-List Prohibited)

Ian Kelly ian.g.kelly at gmail.com
Sat Mar 3 09:03:42 EST 2018


On Fri, Mar 2, 2018 at 9:57 PM, Gregory Ewing
<greg.ewing at canterbury.ac.nz> wrote:
> Paul Rubin wrote:
>>
>> So you want the programmer to put more head scratching into figuring out
>> which reference should be strong and which should be weak?
>
>
> Also, sometimes weak references don't really solve the
> problem, e.g. if you have a graph where you can't identify
> any particular node as a "root" node, and you want the graph
> to stay around as long as any of its nodes are referenced.

I offered two possible solutions for the graph problem elsewhere in this thread.

For the record I'm not in favor of the OP's proposal (although making
the different Python implementations more consistent in their garbage
collection semantics would not be a bad thing per se) but I am
somewhat mystified as to why people seem to think that weak refs are
difficult to use correctly.



More information about the Python-list mailing list