[Python-3000] Fixing super anyone?

Jim Jewett jimjjewett at gmail.com
Tue Apr 24 20:22:27 CEST 2007


On 4/24/07, Steven Bethard <steven.bethard at gmail.com> wrote:

> > class autosuper(type):

> I still get the same error.

No doubt it is fiddly, but he did remind me to look at some of the
older recipes.

In the stdlib test\test_descr.py (inside function metaclass), there is
an autosuper class that comes pretty close to what we want.

I'm not sure we can just add it to type, though, because it relies on
name mangling.
    self.__super.meth()

I think for default behavior, we want either either no underscores, or
matched underscores.

    # too magical?
    self.super.meth()
    self.super().meth()

    # Should a double_underscore method ever "normally" need to be called
    # by name, outside of another double_underscore method?
    self.__super__ .meth()

    # __attribute__ rather than method
    __this_class__.super.meth()

-jJ


More information about the Python-3000 mailing list