From dc5050d7fd711137f83c54aca09c0c6df8d2b2c9 Mon Sep 17 00:00:00 2001 From: Stefan VanBuren Date: Sat, 4 Oct 2025 21:02:42 -0400 Subject: [PATCH] Fix comparisons of list/map to null --- src/celpy/celtypes.py | 6 ++++++ tools/wip.toml | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/celpy/celtypes.py b/src/celpy/celtypes.py index 3e47271..76b898d 100644 --- a/src/celpy/celtypes.py +++ b/src/celpy/celtypes.py @@ -841,6 +841,9 @@ def __ge__(self, other: Any) -> NoReturn: raise TypeError("no such overload") def __eq__(self, other: Any) -> bool: + if other is None: + return False + if not isinstance(other, (list, ListType)): raise TypeError(f"no such overload: ListType == {type(other)}") @@ -928,6 +931,9 @@ def __getitem__(self, key: Any) -> Any: return super().__getitem__(key) def __eq__(self, other: Any) -> bool: + if other is None: + return False + if not isinstance(other, (Mapping, MapType)): raise TypeError(f"no such overload: MapType == {type(other)}") diff --git a/tools/wip.toml b/tools/wip.toml index b2b0709..0b5cdcd 100644 --- a/tools/wip.toml +++ b/tools/wip.toml @@ -76,8 +76,6 @@ not_eq_dyn_double_uint = "@wip" not_eq_dyn_int_double = "@wip" not_eq_dyn_int_null = "@wip" not_eq_dyn_int_uint = "@wip" -not_eq_dyn_list_null = "@wip" -not_eq_dyn_map_null = "@wip" not_eq_dyn_timestamp_null = "@wip" not_eq_dyn_uint_double = "@wip" not_eq_dyn_uint_int = "@wip"