I have a problem and I can’t seem to find a solution. I have 3 classes A, B and C, with A being the superclass.
class A(object):
def __str__(self):
self._general_representation(str)
def _general_representation(self,to_string):
(nominal_value, std_dev) = (self._nominal_value, self.std_dev())
def std_dev(self)
a = error_components()*something
def error_components(self):
return something
class B(A):
class C(B):
I want class C to be able to override the std_dev() and error_components() of the ‘grandparent’ class. How can I do this? I can’t change class A and B. Is there a way to this in python 3.3?
Just define them on class C. The functions are looked up on
self, not on the class the calling method is defined in.