Skip to content

Commit 0cb6937

Browse files
authored
add __eq__ method for OperandHolder class (#8710)
1 parent b221aa2 commit 0cb6937

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rest_framework/permissions.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ def __call__(self, *args, **kwargs):
4646
op2 = self.op2_class(*args, **kwargs)
4747
return self.operator_class(op1, op2)
4848

49+
def __eq__(self, other):
50+
return (
51+
isinstance(other, OperandHolder) and
52+
self.operator_class == other.operator_class and
53+
self.op1_class == other.op1_class and
54+
self.op2_class == other.op2_class
55+
)
56+
4957

5058
class AND:
5159
def __init__(self, op1, op2):

0 commit comments

Comments
 (0)