How can a child class inherit a class method from its parent that gets a class variable from the child in python?
How can a child class inherit a class method from its parent that gets a class variable from the child in python? Question: I have a code here where I define a parent class with class methods and class variables: class Parent: var1 = ‘foo’ var2 = ‘bar’ def getVar1Var2AsString(self): return f'{Parent.getVar1()}_{Parent.getVar2()}’ @classmethod def getVar1(cls): …