From b1800f2a4ef0d45d1fbef5179f9c70e6060d28f4 Mon Sep 17 00:00:00 2001 From: Matt Smith <mjsmith6@illinois.edu> Date: Wed, 31 Jul 2024 17:12:45 -0500 Subject: [PATCH] add missing FunctionDefinition.__eq__ (#533) --- pytato/function.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pytato/function.py b/pytato/function.py index c79dfcf..66a30fc 100644 --- a/pytato/function.py +++ b/pytato/function.py @@ -59,6 +59,7 @@ import enum import re from functools import cached_property from typing import ( + Any, Callable, ClassVar, Hashable, @@ -236,6 +237,15 @@ class FunctionDefinition(Taggable): else: raise NotImplementedError(self.return_type) + def __eq__(self, other: Any) -> bool: + if self is other: + return True + if not isinstance(other, FunctionDefinition): + return False + + from pytato.equality import EqualityComparer + return EqualityComparer().map_function_definition(self, other) + @attrs.frozen(eq=False, repr=False, hash=True, cache_hash=True) class NamedCallResult(NamedArray): -- GitLab