On 05/01/10 05:39, Lie Ryan wrote:
> On 05/01/10 05:16, Nikolaus Rath wrote:
>> Hi,
>>
>> I'm trying to be very clever:
>
>>
>> Apparently Python calls the class attribute __del__ rather than the
>> instance's __del__ attribute. Is that a bug or a feature? Is there any
>> way to implement the desi
Nikolaus Rath wrote:
> Apparently Python calls the class attribute __del__ rather than the
> instance's __del__ attribute. Is that a bug or a feature? Is there any
> way to implement the desired functionality without introducing an
> additional destroy_has_been_called attribute?
For newstyle clas
On 05/01/10 05:16, Nikolaus Rath wrote:
> Hi,
>
> I'm trying to be very clever:
>
> Apparently Python calls the class attribute __del__ rather than the
> instance's __del__ attribute. Is that a bug or a feature? Is there any
> way to implement the desired functionality without introducing an
> a
On Fri, Apr 30, 2010 at 3:16 PM, Nikolaus Rath wrote:
> Apparently Python calls the class attribute __del__ rather than the
> instance's __del__ attribute. Is that a bug or a feature? Is there any
> way to implement the desired functionality without introducing an
> additional destroy_has_been_cal
Hi,
I'm trying to be very clever:
class tst(object):
def destroy(self):
print 'Cleaning up.'
self.__del__ = lambda: None
def __del__(self):
raise RuntimeError('Instance destroyed without running destroy! Hell
may break loose!')
However, it doesn't work: