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, AcWhat is the name resolution order for
super(D, d).x?What is the nro for
self.xinsuper(D, d).f()? Is it the same as ford.f()?What is the nro for
D.x?If I assign to
d.xandDiwasn't there, where will it go? E.g.DiorDcIf I assign to
D.xandDcwasn't there, where will it go?If I assign to
super(D, d).xandBcwasn't there, where will it go? E.g.DiorDcorBc