Python 2.0

Hrvoje Niksic hniksic at srce.hr
Thu Jun 3 15:36:32 EDT 1999


"Barry A. Warsaw" <bwarsaw at cnri.reston.va.us> writes:

> The right approach would be to create a subclass of PyInstance (say
> called PyFinalizingInstance) which /does/ call __del__() and then
> create one of these when building a class that has a __del__
> defined.

Would this right approach ever work in Python?  Given Python's
dynamism, it's perfectly legal to write:

    x.__del__ = FN

where x is an instance of a class without a __del__() method.  But
then again, maybe it would be OK to silently ignore such __del__
methods...




More information about the Python-list mailing list