diff --git a/UM/Settings/SettingRelation.py b/UM/Settings/SettingRelation.py index a574ffd74..2d7182de6 100644 --- a/UM/Settings/SettingRelation.py +++ b/UM/Settings/SettingRelation.py @@ -46,7 +46,11 @@ def __init__(self, owner: SettingDefinition, target: SettingDefinition, relation def __hash__(self) -> int: """Ensure that the SettingRelation is hashable, so it can be used in a set.""" - return hash((self._owner, self._target, self._type, self._role)) + try: + return self._hash + except AttributeError: + self._hash = hash((self._owner, self._target, self._type, self._role)) + return self._hash @property def owner(self) -> SettingDefinition: