from abc import abstractmethod class Component: def __init__(self): self.parent = None @abstractmethod def register(self): pass @abstractmethod def unregister(self): pass