[Python-3000] PEP: Eliminate del (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Sun May 13 03:52:42 CEST 2007
- Previous message: [Python-3000] PEP: Eliminate __del__
- Next message: [Python-3000] PEP: Eliminate __del__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Steven Bethard wrote:
Yep. The 'self' passed to finalize is still an instance of the same class (e.g. BufferedWriter or MyWriter). So inheritance works normally:
However, if the overridden method uses any attributes not mentioned in the original finalattrs, they will need to be added to it somehow.
It might be useful if the metaclass gathered up the contents of finalattr from the class and all its base classes. Then a class could just list its own needed attributes without having to worry about those needed by its base classes.
This also suggests that some care will be needed when overriding methods of a class that uses this recipe. You need to know whether the method can be called from the finalizer, so you can be sure to include the appropriate attributes in finalattrs.
-- Greg
- Previous message: [Python-3000] PEP: Eliminate __del__
- Next message: [Python-3000] PEP: Eliminate __del__
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]