I have the following simplified diagram:
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'm looking for what I should use instead print('is _score_funct implemented?')to find out if a subclass is already implemented _score_funct(network)or not.
Note. If there is a more pythonic / regular way of structuring code, I would also like to mention its mention. The reason I defined it this way: some NetworkAnalyzer subclasses have _score_funct in their definition, and those that don't have it will have different variable initialization, although they will have the same structure
source
share