diff --git a/conservancy_beancount/data.py b/conservancy_beancount/data.py index 6509ab0438d46e54f4b51da106f7f582beac4da8..3af7eff9bab6d6a3fa85c86a33cc08f0088b09f0 100644 --- a/conservancy_beancount/data.py +++ b/conservancy_beancount/data.py @@ -62,6 +62,8 @@ class Account(str): or Income:Donations. This class provides additional methods for common account name parsing and queries. """ + __slots__ = () + SEP = bc_account.sep def is_checking(self) -> bool: @@ -115,6 +117,7 @@ class Metadata(MutableMapping[MetaKey, MetaValue]): This class wraps a Beancount metadata dictionary with additional methods for common parsing and query tasks. """ + __slots__ = ('meta',) def __init__(self, source: MutableMapping[MetaKey, MetaValue]) -> None: self.meta = source @@ -165,6 +168,7 @@ class PostingMeta(Metadata): Under the hood, this class does a little extra work to avoid creating posting metadata if it doesn't have to. """ + __slots__ = ('txn', 'index', 'post') def __init__(self, txn: Transaction, @@ -207,6 +211,7 @@ class Posting(BasePosting): * The `account` field is an Account object * The `meta` field is a PostingMeta object """ + __slots__ = () account: Account # mypy correctly complains that our MutableMapping is not compatible