I will only have a single Abstract Class in this particular module and so I\'m trying to avoid importing the \"ABC\" package. See below for my attempt and the issue I\'m running
You're expecting each child class to have self.requirements
right? So change the following code to this.
class Event(object):
@property
def requirements(self):
try:
return self._requirements
except AttributeError:
raise NotImplementedError('subclasses must have requirements')
That way it will return self.requirements. If self.requirements hasn't been implemented by the child class it will raise a not implemented error.
EDIT: Updated return to avoid never-ending loop.