I’m looking for a nice solution to avoid code duplication, my code look like this;
class HostEnvironment(AbstractEnvironment):
def provision(self, wait_for_sshd=True):
some code
def __init__(self, layer_info):
pass
class VCBEnvironment(HostEnvironment):
def provision(self, wait_for_sshd=True):
same code
plus some more code
def __init__(self, layer_info):
super(VCBEnvironment, self).__init__(layer_info)
super()in the__init__method. Why can't you use that instead ofsame codeinVCBEnvironment.provision()exactly?supercan be used for methods besides the__init__method.