diff --git a/pydantic_changedetect/changedetect.py b/pydantic_changedetect/changedetect.py index 6809d2e..b902191 100644 --- a/pydantic_changedetect/changedetect.py +++ b/pydantic_changedetect/changedetect.py @@ -206,7 +206,7 @@ def model_set_changed(self, *fields: str, original: Any = NO_VALUE) -> None: self.model_original[name] = original self.model_self_changed_fields.add(name) - def _model_is_change_comparable_type(self, value: Any) -> bool: + def _model_value_is_comparable_type(self, value: Any) -> bool: return ( value is None or isinstance(value, (str, int, float, bool, decimal.Decimal)) @@ -241,8 +241,8 @@ def __setattr__(self, name, value) -> None: # noqa: ANN001 # (when validate_assignment == True) current_value = self.__dict__[name] if ( - self._model_is_change_comparable_type(original_value) - and self._model_is_change_comparable_type(current_value) + self._model_value_is_comparable_type(original_value) + and self._model_value_is_comparable_type(current_value) and original_value == current_value ): has_changed = False