[Python-3000] PEP: Eliminate __del__
Steven Bethard
steven.bethard at gmail.com
Sun May 13 04:18:09 CEST 2007
On 5/12/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> 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.
You already don't need to list the attributes from the base classes.
The __finalattrs__ are converted into class level descriptors, so if
class D inherits from class C, it has the __finalattrs__ descriptors
for both classes.
Did you try it and find that it didn't work?
STeVe
--
I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a
tiny blip on the distant coast of sanity.
--- Bucky Katt, Get Fuzzy
More information about the Python-3000
mailing list