diff --git a/hyperscript/element.py b/hyperscript/element.py index de0655b..b78619c 100644 --- a/hyperscript/element.py +++ b/hyperscript/element.py @@ -131,6 +131,4 @@ def _parts(self, remove_empty: bool = False) -> list[str]: def __eq__(self, other: Any) -> bool: if isinstance(other, Element): return str(self) == str(other) - if isinstance(other, str): - return str(self) == other - return False + return super().__eq__(other) diff --git a/tests/test_element.py b/tests/test_element.py index 9a51f1e..2a46f7b 100644 --- a/tests/test_element.py +++ b/tests/test_element.py @@ -84,8 +84,6 @@ def test_equality(self) -> None: self.assertEqual(h("div", h("p", "Foo")), h("div", h("p", "Foo"))) - self.assertEqual(h("div", h("p", "Foo")), "
Foo