Skip to content

Commit

Permalink
use is true for bool var (#3973)
Browse files Browse the repository at this point in the history
  • Loading branch information
adhami3310 authored Sep 23, 2024
1 parent ee3b0e6 commit 47c9938
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 0 additions & 8 deletions reflex/vars/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,6 @@ def strip(self) -> StringVar:
"""
return string_strip_operation(self)

def bool(self):
"""Boolean conversion.
Returns:
The boolean value of the string.
"""
return self.length() != 0

def reversed(self) -> StringVar:
"""Reverse the string.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_var.py
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ def test_all_number_operations():
[
(Var.create(False), "false"),
(Var.create(True), "true"),
(Var.create("false"), '("false".split("").length !== 0)'),
(Var.create("false"), 'isTrue("false")'),
(Var.create([1, 2, 3]), "isTrue([1, 2, 3])"),
(Var.create({"a": 1, "b": 2}), 'isTrue(({ ["a"] : 1, ["b"] : 2 }))'),
(Var("mysterious_var"), "isTrue(mysterious_var)"),
Expand Down

0 comments on commit 47c9938

Please sign in to comment.