Given
class A:
x = 'Ac'
def f(self):
return self.x
class B(A):
x = 'Bc'
def f(self):
return self.x
class C(A):
x = 'Cc'
def f(self):
return self.x
class D(B, C):
x = 'Dc'
def __init__(self):
self.x = 'Di'
def f(self):
return self.x
d = D()
What is the name resolution order for
d.x
? E.g.Di, Dc, Bc, Cc, Ac
What is the name resolution order for
super(D, d).x
?What is the nro for
self.x
insuper(D, d).f()
? Is it the same as ford.f()
?What is the nro for
D.x
?If I assign to
d.x
andDi
wasn't there, where will it go? E.g.Di
orDc
If I assign to
D.x
andDc
wasn't there, where will it go?If I assign to
super(D, d).x
andBc
wasn't there, where will it go? E.g.Di
orDc
orBc