[Python-3000] [Python-Dev] PEP 367: New Super

Jim Jewett jimjjewett at gmail.com
Sat May 26 17:47:47 CEST 2007


On 5/25/07, Guido van Rossum <guido at python.org> wrote:

> We could make the class in question a fourth attribute of the (poorly
> named) "bound method" object, e.g. im_class_for_super (im_super would
> be confusing IMO).

In the past, you have referred to this as the static class.

I think it has other uses as well, such as a class-wide registry
(whose location shouldn't be redirected without overriding the whole
method).

I realize this is the rejected __this_class__ proposal, but I can't
help feeling that if we're going to create the magic attribute anyhow,
it makes sense to have it be generally usable, instead of only as a
token to create a super.

> In my proposal the 'super' variable contains whatever
> __super__(<class>, <inst>) returned, rather than <class> which you
> seem to be proposing here.

That's fine, but the <class> still has to be stored with the method to
generate that super -- so why not expose it too?

-jJ


More information about the Python-3000 mailing list