Message82731
Actually, it's essential to how super() works. Here's an example using
single inheritance:
class A(object):
def foo(self):
print 'A'
class B(object):
def foo(self):
super(B, self).foo()
print 'B'
class C(object):
def foo(self):
super(C, self).foo()
print 'C'
x = C()
x.foo()
The "super" in x.foo() return a proxy for x that skips C.
Next, we call foo() on that proxy, which calls B's foo().
In B's foo(), "self" is the proxy. B's foo() passes the proxy to
super(), returning a new proxy for x that skips C and B. Finally, we
call foo() on the new proxy, which calls A's foo(). |
|
Date |
User |
Action |
Args |
2009-02-25 23:33:40 | stutzbach | set | recipients:
+ stutzbach, georg.brandl, rhettinger, LambertDW |
2009-02-25 23:33:40 | stutzbach | set | messageid: <1235604820.75.0.238760199722.issue5229@psf.upfronthosting.co.za> |
2009-02-25 23:33:27 | stutzbach | link | issue5229 messages |
2009-02-25 23:33:27 | stutzbach | create | |
|