mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 08:14:16 +03:00
add __eq__
method for OperandHolder
class (#8710)
This commit is contained in:
parent
b221aa2cf6
commit
0cb693700f
|
@ -46,6 +46,14 @@ class OperandHolder(OperationHolderMixin):
|
|||
op2 = self.op2_class(*args, **kwargs)
|
||||
return self.operator_class(op1, op2)
|
||||
|
||||
def __eq__(self, other):
|
||||
return (
|
||||
isinstance(other, OperandHolder) and
|
||||
self.operator_class == other.operator_class and
|
||||
self.op1_class == other.op1_class and
|
||||
self.op2_class == other.op2_class
|
||||
)
|
||||
|
||||
|
||||
class AND:
|
||||
def __init__(self, op1, op2):
|
||||
|
|
Loading…
Reference in New Issue
Block a user