I have existing classes which inherit from each other…they already have a attribute which is being overridden in subclasses . I want the dictionary attribute to be updated instead of overridden…code below …
class A:
d = {1:2}
class B(A):
d = {3:4}
b=B()
print b.d[1]
2
print b.d[3]
4
Is this possible at all? Say using metaclasses in a way that I can't think of readily.