RFC: Proposal: Deterministic Object Destruction

Chris Angelico rosuav at gmail.com
Sun Mar 4 09:19:06 EST 2018


On Mon, Mar 5, 2018 at 1:11 AM, Ooomzay <ooomzay at gmail.com> wrote:
> On Sunday, 4 March 2018 03:00:13 UTC, Chris Angelico  wrote:
>> This thread is dead. The OP wants to wave a magic wand and say
>> "__del__ is now guaranteed to be called immediately",
>
> No "magic" required: Just one line change in the language reference will do it.

Go ahead and actually implement it. It's not just one line in the
language reference.

>> without any explanation
>
> The PEP says it all really: To make the very pythonic RAII idiom available in python.
>
>> - and, from the look of things, without any understanding
>> - of what that means for the language
>
> What impact on the _language_ (c.f. interpreter) do you think I have not understood?
>
> It is is 100% backwards compatible with the language. It breaks nothing.
>
> It allows people who want to use the RAII idiom to do so.
>
> It allows people who want to use the "with" idiom to continue do so.
>
>> and the interpreters.
>
> I am well aware of what it will mean for interpreters. For some interpreters it will have zero impact (e.g. CPython) and for some others it would unlikely be economic to make them comply.
>

I don't even understand you now. First off, you just acknowledged that
this WILL impact CPython - you're not simply mandating what CPython
already does, you're tightening up the rules significantly. For others
- what do you even mean, "unlikely be economic to make them comply"?
Are you saying that the Jython project should simply die? Or that it
should become non-compliant with the Python spec? Huh?

ChrisA



More information about the Python-list mailing list