2020from reflex .constants .base import Dirs
2121from reflex .utils .exceptions import PrimitiveUnserializableToJSON , VarTypeError
2222from reflex .utils .imports import ImportDict , ImportVar
23- from reflex .utils .types import is_optional
2423
2524from .base import (
2625 CustomVarOperationReturn ,
@@ -431,7 +430,7 @@ def __lt__(self, other: Any):
431430 """
432431 if not isinstance (other , NUMBER_TYPES ):
433432 raise_unsupported_operand_types ("<" , (type (self ), type (other )))
434- return less_than_operation (self , + other )
433+ return less_than_operation (+ self , + other )
435434
436435 @overload
437436 def __le__ (self , other : number_types ) -> BooleanVar : ...
@@ -450,7 +449,7 @@ def __le__(self, other: Any):
450449 """
451450 if not isinstance (other , NUMBER_TYPES ):
452451 raise_unsupported_operand_types ("<=" , (type (self ), type (other )))
453- return less_than_or_equal_operation (self , + other )
452+ return less_than_or_equal_operation (+ self , + other )
454453
455454 def __eq__ (self , other : Any ):
456455 """Equal comparison.
@@ -462,7 +461,7 @@ def __eq__(self, other: Any):
462461 The result of the comparison.
463462 """
464463 if isinstance (other , NUMBER_TYPES ):
465- return equal_operation (self , + other )
464+ return equal_operation (+ self , + other )
466465 return equal_operation (self , other )
467466
468467 def __ne__ (self , other : Any ):
@@ -475,7 +474,7 @@ def __ne__(self, other: Any):
475474 The result of the comparison.
476475 """
477476 if isinstance (other , NUMBER_TYPES ):
478- return not_equal_operation (self , + other )
477+ return not_equal_operation (+ self , + other )
479478 return not_equal_operation (self , other )
480479
481480 @overload
@@ -495,7 +494,7 @@ def __gt__(self, other: Any):
495494 """
496495 if not isinstance (other , NUMBER_TYPES ):
497496 raise_unsupported_operand_types (">" , (type (self ), type (other )))
498- return greater_than_operation (self , + other )
497+ return greater_than_operation (+ self , + other )
499498
500499 @overload
501500 def __ge__ (self , other : number_types ) -> BooleanVar : ...
@@ -514,17 +513,7 @@ def __ge__(self, other: Any):
514513 """
515514 if not isinstance (other , NUMBER_TYPES ):
516515 raise_unsupported_operand_types (">=" , (type (self ), type (other )))
517- return greater_than_or_equal_operation (self , + other )
518-
519- def bool (self ):
520- """Boolean conversion.
521-
522- Returns:
523- The boolean value of the number.
524- """
525- if is_optional (self ._var_type ):
526- return boolify ((self != None ) & (self != 0 )) # noqa: E711
527- return self != 0
516+ return greater_than_or_equal_operation (+ self , + other )
528517
529518 def _is_strict_float (self ) -> bool :
530519 """Check if the number is a float.
0 commit comments