[Python-Dev] Design question: call __del__ only after successful __init__?
bwarsaw@cnri.reston.va.us
bwarsaw@cnri.reston.va.us
Thu, 2 Mar 2000 17:52:31 -0500 (EST)
>>>>> "GvR" == Guido van Rossum <guido@python.org> writes:
GvR> But the other behavior (call __del__ even when __init__
GvR> fails) can also easily be accomplished in Python:
It's a fair cop.
GvR> I believe that in almost all cases the programmer would be
GvR> happier if __del__ wasn't called when their __init__ fails.
GvR> This makes it easier to write a __del__ that can assume that
GvR> all the object's fields have been properly initialized.
That's probably fine; I don't have strong feelings either way.
-Barry
P.S. Interesting what X-Oblique-Strategy was randomly inserted in this
message (but I'm not sure which approach is more "explicit" :).
-Barry