diff options
Diffstat (limited to 'django/core/validators.py')
-rw-r--r-- | django/core/validators.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/core/validators.py b/django/core/validators.py index 2e00ca3ff3..38345a844f 100644 --- a/django/core/validators.py +++ b/django/core/validators.py @@ -324,8 +324,9 @@ class BaseValidator: raise ValidationError(self.message, code=self.code, params=params) def __eq__(self, other): + if not isinstance(other, self.__class__): + return NotImplemented return ( - isinstance(other, self.__class__) and self.limit_value == other.limit_value and self.message == other.message and self.code == other.code |