diff --git a/src/fable-library-py/fable_library/util.py b/src/fable-library-py/fable_library/util.py index 45cc9775bb..2fd2be0d3b 100644 --- a/src/fable-library-py/fable_library/util.py +++ b/src/fable-library-py/fable_library/util.py @@ -217,11 +217,9 @@ class DateKind(IntEnum): def equals(a: Any, b: Any) -> bool: - if a is b: - return True - - # Check for NoneTypes (ex Some [1] = None) match (a, b): + case (a, b) if a is b: + return True # Don't test (None, None) here, because a is b already covers that # case (None, None): # return True @@ -229,13 +227,10 @@ def equals(a: Any, b: Any) -> bool: return False case (_, None): return False - case (_, _): - pass - - if is_array_like(a): - return equal_arrays(a, b) - - return a == b + case (a, b) if is_array_like(a): + return equal_arrays(a, b) + case _: + return a == b def is_comparable(x: Any) -> bool: