[Python-Dev] Multiple inheritance

Greg Ward gward@python.net
Fri, 4 May 2001 14:12:44 -0400


On 03 May 2001, Paul F. Dubois said:
> 1. The simple case, X inherits from Y and in defining foo and bar needs to
> use Y's version:
> 
> class X (Y rename foo as _sfoo,
>                   bar as _sbar
>         ):

Maybe I'm being thick, but don't you get the same effect by doing this:

class X (Y):
    _sfoo = Y.foo
    _sbar = Y.bar

...or would the "rename" syntax also hide the "foo" and "bar" names from
X's effective namespace[1]?  In that case, I guess some special syntax
is needed.

[1] "effective namespace" -- the union of X's class dict with all its
superclass' dicts; not actually X's namespace, but the set of names you
can use in X.  I think.  Err, whatever.

        Greg