Python 2.0

Graham Matthews graham at sloth.math.uga.edu
Tue Jun 8 15:39:11 EDT 1999


Graham Matthews wrote:
> I really don't understand this. A lot of languages (eg. Java) have
> garbage collection and finalisers. All these languages manage to delete
> objects in an order that does not cause any problems (all finalisers etc
> work).
Salvador =?iso-8859-1?Q?Fandi=F1o?= (fandino at usa.net) wrote:
: I have been using Java since it was invented and I haven't programed a
: finaliser ever. They should run under so unknown and inconsistent
: environment that they are not usable at all (except for freeing external
: resources).

I am not sure I understand this. Can you explain to me how a finaliser
can run in an unknown environment. Surely everything the finaliser needs
is referenced by the finaliser (either directly or indirectly) and hence 
is still there.

Salvador =?iso-8859-1?Q?Fandi=F1o?= (fandino at usa.net) wrote:
: BTW, how could be acceptable that the same __del__ method could be
: called from two totally different schemes (GC reclaiming objects or
: reference count becoming 0)? it would break all the library classes that
: now use __del__ .

Because anything referenced by a __del__ method will always be there
when the __del__ is called, under any GC scheme.

graham
-- 
           As you grow up and leave the playground
       where you kissed your prince and found your frog
          Remember the jester that showed you tears
                   the script for tears




More information about the Python-list mailing list