Skip to content

Commit 78dee18

Browse files
author
Sunny Nguyen
authored
Fix instance comparison in AbsMax and AbsMin classes
- Changed identity comparison (is not) to instance checking (isinstance) - Fixes incorrect behavior when comparing instances of same class
1 parent 5440442 commit 78dee18

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/validators/_extremes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class AbsMax:
2323

2424
def __ge__(self, other: Any):
2525
"""GreaterThanOrEqual."""
26-
return other is not AbsMax
26+
return not isinstance(other, AbsMax)
2727

2828

2929
@total_ordering
@@ -44,4 +44,4 @@ class AbsMin:
4444

4545
def __le__(self, other: Any):
4646
"""LessThanOrEqual."""
47-
return other is not AbsMin
47+
return not isinstance(other, AbsMin)

0 commit comments

Comments
 (0)