On 9/26/06, Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> wrote: > "Giovanni Bajo" <[EMAIL PROTECTED]> writes:
> > Guido was proposing a solution with __del__ and CT, which > > approximately worked this way: > > - When a CT is detected, any __del__ method is invoked once per > > instance, in random order. [Note that this "__del__" is closer to what we've been calling __close__ than to the existing __del__.] Note that the "at most" part of "once" is already a stronger promise than __close__. That's OK (maybe even helpful) for users, it just makes the implementation harder. > This means that __del__ [~= __close__] may attempt to use an object which > has already had its __del__ called. Yes; this is the most important change between between today's __del__ and the proposed __close__. Today's __del__ doesn't have to defend against messed up subobjects, because it immortalizes them. A __close__ method would need to defend against this, because of the arbitrary ordering. In practice, close methods already defend against this anyhow, largely because they know that they might be called by __del__ even after being called explicitly. -jJ _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
