Skip to content

Commit dc5050d

Browse files
Fix comparisons of list/map to null
1 parent 443a79f commit dc5050d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/celpy/celtypes.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,9 @@ def __ge__(self, other: Any) -> NoReturn:
841841
raise TypeError("no such overload")
842842

843843
def __eq__(self, other: Any) -> bool:
844+
if other is None:
845+
return False
846+
844847
if not isinstance(other, (list, ListType)):
845848
raise TypeError(f"no such overload: ListType == {type(other)}")
846849

@@ -928,6 +931,9 @@ def __getitem__(self, key: Any) -> Any:
928931
return super().__getitem__(key)
929932

930933
def __eq__(self, other: Any) -> bool:
934+
if other is None:
935+
return False
936+
931937
if not isinstance(other, (Mapping, MapType)):
932938
raise TypeError(f"no such overload: MapType == {type(other)}")
933939

tools/wip.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ not_eq_dyn_double_uint = "@wip"
7676
not_eq_dyn_int_double = "@wip"
7777
not_eq_dyn_int_null = "@wip"
7878
not_eq_dyn_int_uint = "@wip"
79-
not_eq_dyn_list_null = "@wip"
80-
not_eq_dyn_map_null = "@wip"
8179
not_eq_dyn_timestamp_null = "@wip"
8280
not_eq_dyn_uint_double = "@wip"
8381
not_eq_dyn_uint_int = "@wip"

0 commit comments

Comments
 (0)