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

Chris Angelico rosuav at gmail.com
Sat Mar 3 12:35:52 EST 2018


On Sun, Mar 4, 2018 at 3:19 AM, Richard Damon <Richard at damon-family.org> wrote:
> One idea does come to mind though, would it be reasonable, and somewhat
> Pythonic, for a class to define member functions like __ref__ and __unref__
> (or perhaps some other name) that if defined, would be called every time a
> name was bound or unbound to an object?

Just a thought, here: would __ref__ be called every time a new
function-local name is bound to an object? For instance, when a method
is called, and its 'self' parameter gets set to that object?

That miiiiiight be a little problematic.

ChrisA



More information about the Python-list mailing list