On 4/18/06, Michael Urman <[EMAIL PROTECTED]> wrote:
> On 4/18/06, Guido van Rossum <[EMAIL PROTECTED]> wrote:
> > Hardly the same mechanism; __private is done by low-level name
> > mangling in the early stages of the compiler. super() would need a
> > class object to be reliable; the class *name* (which is all that's
> > available at compile time) might resolve to something else at runtime.
>
> That's all the current super() gets, right? super(Base, self).meth()
> compiles with a LOAD_GLOBAL (Base)... Any mechanisms I can think of to
> solidify that into the actual class reference either rely on
> __mangled_attrs being assigned at or after class construction, or
> potentially break in inherited classes.

Sure. But that's all for anyone to see in the code. OTOH, if super
were implicit, it would be fair to expect it to do the right thing
w.r.t. the current class object. IOW an implicit super is held to a
higher standard than the current explicit super.

--
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to