diff --git a/drafthorse/models/container.py b/drafthorse/models/container.py index f5ec87e..30cdfe3 100644 --- a/drafthorse/models/container.py +++ b/drafthorse/models/container.py @@ -1,4 +1,6 @@ class Container: + __slots__ = ("children", "child_type") + def __init__(self, child_type): super().__init__() self.children = [] @@ -26,6 +28,8 @@ def add_from_etree(self, root, strict=True): class SimpleContainer(Container): + __slots__ = ("children", "child_type", "namespace", "tag") + def __init__(self, child_type, namespace, tag): super().__init__(child_type) self.namespace = namespace @@ -51,6 +55,8 @@ def add_from_etree(self, root, strict=True): class CurrencyContainer(SimpleContainer): + __slots__ = ("children", "child_type", "namespace", "tag") + def empty_element(self): from .elements import CurrencyElement @@ -65,6 +71,8 @@ def add_from_etree(self, root, strict=True): class IDContainer(SimpleContainer): + __slots__ = ("children", "child_type", "namespace", "tag") + def empty_element(self): from .elements import IDElement @@ -79,6 +87,8 @@ def add_from_etree(self, root, strict=True): class StringContainer(SimpleContainer): + __slots__ = ("children", "child_type", "namespace", "tag") + def empty_element(self): from .elements import StringElement