Jun-05-2019, 09:57 PM
Hi all
I have an abstract class with a mixture of abstract methods and fully implemented methods. The latter are correct for 99.9% of the derived classes. Please refer to snippets
I have an abstract class with a mixture of abstract methods and fully implemented methods. The latter are correct for 99.9% of the derived classes. Please refer to snippets
import abc import pprint class connect(metaclass=abc.ABCMeta) def __init__(self, config): self._config = config: @abc.abstractmethod def message(self): pass def printconfig (self): config = self._config pprint.pprint (config) class connectASE (connect): def message(self): config = self._config message = config.get('message') print (message) # so far so good, but let's say that in this particular class I want # to divert from the standard printconfig and do def printconfig (self): config = self._config print ("Note that this is connectASE") pprint.pprint (config)would that work