I have the following simplified scheme:
class NetworkAnalyzer(object):
def __init__(self):
print('is _score_funct implemented?')
@staticmethod
def _score_funct(network):
raise NotImplementedError
class LS(NetworkAnalyzer):
@staticmethod
def _score_funct(network):
return network
and I am looking for what I should use instead of print('is _score_funct implemented?')
in order to figure out if a subclass has already implemented _score_funct(network)
or not.
Note: If there is a more pythonic/conventional way of structuring the code, I would also appreciate its mention. The reason I defined it this way is, some NetworkAnalyzer subclasses have _score_funct in their definition, and the ones that dont have it will have different initialization of variables although they will have the same structure