diff --git a/conservancy_beancount/plugin/core.py b/conservancy_beancount/plugin/core.py index 62df122..c9c8af1 100644 --- a/conservancy_beancount/plugin/core.py +++ b/conservancy_beancount/plugin/core.py @@ -69,12 +69,10 @@ class Hook(Generic[Entry], metaclass=abc.ABCMeta): @abc.abstractmethod def run(self, entry: Entry) -> errormod.Iter: ... - def __init_subclass__(cls) -> None: - # cls.__orig_bases__ comes from the ABCMeta metaclass - cls.DIRECTIVE = cls.__orig_bases__[0].__args__[0] # type:ignore[attr-defined] +class TransactionHook(Hook[Transaction]): + DIRECTIVE = Transaction -TransactionHook = Hook[Transaction] ### HELPER CLASSES