diff --git a/pynecone/var.py b/pynecone/var.py index c31ca1b9b..52db1bb16 100644 --- a/pynecone/var.py +++ b/pynecone/var.py @@ -373,7 +373,7 @@ class Var(ABC): Returns: A var representing the equality comparison. """ - return self.compare("==", other) + return self.compare("===", other) def __ne__(self, other: Var) -> Var: """Perform an inequality comparison. @@ -384,7 +384,7 @@ class Var(ABC): Returns: A var representing the inequality comparison. """ - return self.compare("!=", other) + return self.compare("!==", other) def __gt__(self, other: Var) -> Var: """Perform a greater than comparison. diff --git a/tests/test_var.py b/tests/test_var.py index a81b2b30a..c2aba06e5 100644 --- a/tests/test_var.py +++ b/tests/test_var.py @@ -167,8 +167,8 @@ def test_basic_operations(TestObj): Args: TestObj: The test object. """ - assert str(v(1) == v(2)) == "{(1 == 2)}" - assert str(v(1) != v(2)) == "{(1 != 2)}" + assert str(v(1) == v(2)) == "{(1 === 2)}" + assert str(v(1) != v(2)) == "{(1 !== 2)}" assert str(v(1) < v(2)) == "{(1 < 2)}" assert str(v(1) <= v(2)) == "{(1 <= 2)}" assert str(v(1) > v(2)) == "{(1 > 2)}"