From 665a18b063cd995b2aa936bb5a5a114f97ea03ba Mon Sep 17 00:00:00 2001 From: gavin Date: Mon, 13 May 2024 12:13:41 +0200 Subject: [PATCH] fix: Implement Truthy.__eq __ Implement equality check, compare with True rather than self for a Truthy instance Co-authored-by: Ankush Menat --- frappe/utils/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frappe/utils/__init__.py b/frappe/utils/__init__.py index 304cedcfc0..ceba8bab05 100644 --- a/frappe/utils/__init__.py +++ b/frappe/utils/__init__.py @@ -1178,6 +1178,9 @@ class Truthy: def __bool__(self): return True + def __eq__(self, other: object) -> bool: + return True == other # noqa: E712 + def __repr__(self) -> str: _val = "UNSET" if self.value is UNSET else self.value _ctx = "UNSET" if self.context is UNSET else self.context