Merge pull request #1073 from langchain-ai/nc/19jul/binop-lambda-eq

Don't include lambdas in __eq__ for BinOp
This commit is contained in:
Nuno Campos
2024-07-22 08:41:30 -07:00
committed by GitHub
+5 -3
View File
@@ -56,9 +56,11 @@ class BinaryOperatorAggregate(Generic[Value], BaseChannel[Value, Value, Value]):
pass
def __eq__(self, value: object) -> bool:
return (
isinstance(value, BinaryOperatorAggregate)
and value.operator == self.operator
return isinstance(value, BinaryOperatorAggregate) and (
value.operator is self.operator
if value.operator.__name__ != "<lambda>"
and self.operator.__name__ != "<lambda>"
else True
)
@property