Le Tue, 19 May 2009 19:27:16 +0100,
"Alan Gauld" s'exprima ainsi:
> > def __del__(self):
> >try:
> >self.f.close()
> >except:
> >pass
>
> This is, I agree, pointless. but very different to:
>
> def __ del__(self):
> try:
> os.remove(self.lockname)
> e
"David Stanek" wrote
But I think (someone confirms/contradicts?) there is no harm
in overloading a class's __del__ to accomplish additional tasks
such as deleting temp disk space/dirs/files that need to exist
only during object creation.
Incorrect.
Why?
implementation. By the time it
On Tue, May 19, 2009 at 5:55 AM, spir wrote:
> Le Tue, 19 May 2009 09:12:34 +0200,
> "A.T.Hofkamp" s'exprima ainsi:
>
>> A folder is created during object instantiation.
>
> Do you mean a filesytem directory? I may be wrong, bit it seems there is a
> bit of confusion between things and their rep
Le Tue, 19 May 2009 09:12:34 +0200,
"A.T.Hofkamp" s'exprima ainsi:
> A folder is created during object instantiation.
Do you mean a filesytem directory? I may be wrong, bit it seems there is a bit
of confusion between things and their representation as python objects.
You shouldn't call __del_
Strax-Haber, Matthew (LARC-D320) wrote:
A folder is created during object instantiation. This is necessary because
multiple other methods depend on the existence of that folder, and in the
future things may be running in parallel so it has to be there for the
entire life of the object. Before the
> I've been told numerous times that using __del__ is not the way to handle
> clean-up because it is finicky.
matthew,
welcome to Python and this Tutor mailing list!
and yes, i'll echo everyone else in saqying that using __del__ should
be avoided. the most critical issues regarding this is becau
"Strax-Haber, Matthew (LARC-D320)" wrote
My class sub-types dict. In __init__, there is a call to
self.update(pickle.load()). For some reason, this triggers
__del__. Why?
A pure guess, but maybe the pickle load creates a new instance which
replaces the original which then gets garbage col
To all the generous Python coders on this list,
I've been told numerous times that using __del__ is not the way to handle
clean-up because it is finicky. Fine. However, how should I handle the
following problem:
A folder is created during object instantiation. This is necessary because
multiple ot