implement hash for all functions
This commit is contained in:
parent
c397cb2b04
commit
81cd679802
@ -947,6 +947,14 @@ class AndOperation(ImmutableVar):
|
|||||||
"""
|
"""
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Calculates the hash value of the object.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
int: The hash value of the object.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self._var1, self._var2))
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(
|
@dataclasses.dataclass(
|
||||||
eq=False,
|
eq=False,
|
||||||
@ -1028,6 +1036,14 @@ class OrOperation(ImmutableVar):
|
|||||||
"""
|
"""
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Calculates the hash value for the object.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
int: The hash value of the object.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self._var1, self._var2))
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(
|
@dataclasses.dataclass(
|
||||||
eq=False,
|
eq=False,
|
||||||
@ -1074,3 +1090,11 @@ class ImmutableCallableVar(ImmutableVar):
|
|||||||
The Var returned from calling the function.
|
The Var returned from calling the function.
|
||||||
"""
|
"""
|
||||||
return self.fn(*args, **kwargs)
|
return self.fn(*args, **kwargs)
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Calculate the hash of the object.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The hash of the object.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.original_var))
|
||||||
|
@ -135,6 +135,14 @@ class VarOperationCall(ImmutableVar):
|
|||||||
"""Post-initialize the var."""
|
"""Post-initialize the var."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def __hash__(self):
|
||||||
|
"""Hash the var.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The hash of the var.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self._func, self._args))
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(
|
@dataclasses.dataclass(
|
||||||
eq=False,
|
eq=False,
|
||||||
@ -214,6 +222,14 @@ class ArgsFunctionOperation(FunctionVar):
|
|||||||
def __post_init__(self):
|
def __post_init__(self):
|
||||||
"""Post-initialize the var."""
|
"""Post-initialize the var."""
|
||||||
|
|
||||||
|
def __hash__(self):
|
||||||
|
"""Hash the var.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The hash of the var.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self._args_names, self._return_expr))
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(
|
@dataclasses.dataclass(
|
||||||
eq=False,
|
eq=False,
|
||||||
@ -290,5 +306,13 @@ class ToFunctionOperation(FunctionVar):
|
|||||||
"""
|
"""
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self):
|
||||||
|
"""Hash the var.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The hash of the var.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self._original_var))
|
||||||
|
|
||||||
|
|
||||||
JSON_STRINGIFY = FunctionStringVar("JSON.stringify")
|
JSON_STRINGIFY = FunctionStringVar("JSON.stringify")
|
||||||
|
@ -400,6 +400,14 @@ class BinaryNumberOperation(NumberVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Calculate the hash value of the object.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
int: The hash value of the object.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.a, self.b))
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(
|
@dataclasses.dataclass(
|
||||||
eq=False,
|
eq=False,
|
||||||
@ -467,6 +475,14 @@ class UnaryNumberOperation(NumberVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Calculate the hash value of the object.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
int: The hash value of the object.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.a))
|
||||||
|
|
||||||
|
|
||||||
class NumberAddOperation(BinaryNumberOperation):
|
class NumberAddOperation(BinaryNumberOperation):
|
||||||
"""Base class for immutable number vars that are the result of an addition operation."""
|
"""Base class for immutable number vars that are the result of an addition operation."""
|
||||||
@ -827,6 +843,14 @@ class BooleanToIntOperation(NumberVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Calculate the hash value of the object.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
int: The hash value of the object.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.a))
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(
|
@dataclasses.dataclass(
|
||||||
eq=False,
|
eq=False,
|
||||||
@ -899,6 +923,14 @@ class ComparisonOperation(BooleanVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Calculate the hash value of the object.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
int: The hash value of the object.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.a, self.b))
|
||||||
|
|
||||||
|
|
||||||
class GreaterThanOperation(ComparisonOperation):
|
class GreaterThanOperation(ComparisonOperation):
|
||||||
"""Base class for immutable boolean vars that are the result of a greater than operation."""
|
"""Base class for immutable boolean vars that are the result of a greater than operation."""
|
||||||
@ -1058,6 +1090,14 @@ class LogicalOperation(BooleanVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Calculate the hash value of the object.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
int: The hash value of the object.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.a, self.b))
|
||||||
|
|
||||||
|
|
||||||
class BooleanNotOperation(BooleanVar):
|
class BooleanNotOperation(BooleanVar):
|
||||||
"""Base class for immutable boolean vars that are the result of a logical NOT operation."""
|
"""Base class for immutable boolean vars that are the result of a logical NOT operation."""
|
||||||
@ -1115,6 +1155,14 @@ class BooleanNotOperation(BooleanVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Calculate the hash value of the object.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
int: The hash value of the object.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.a))
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(
|
@dataclasses.dataclass(
|
||||||
eq=False,
|
eq=False,
|
||||||
@ -1279,6 +1327,14 @@ class ToNumberVarOperation(NumberVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Calculate the hash value of the object.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
int: The hash value of the object.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self._original_value))
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(
|
@dataclasses.dataclass(
|
||||||
eq=False,
|
eq=False,
|
||||||
@ -1347,6 +1403,14 @@ class ToBooleanVarOperation(BooleanVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Calculate the hash value of the object.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
int: The hash value of the object.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self._original_value))
|
||||||
|
|
||||||
|
|
||||||
class TernaryOperator(ImmutableVar):
|
class TernaryOperator(ImmutableVar):
|
||||||
"""Base class for immutable vars that are the result of a ternary operation."""
|
"""Base class for immutable vars that are the result of a ternary operation."""
|
||||||
@ -1427,3 +1491,13 @@ class TernaryOperator(ImmutableVar):
|
|||||||
|
|
||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Calculate the hash value of the object.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
int: The hash value of the object.
|
||||||
|
"""
|
||||||
|
return hash(
|
||||||
|
(self.__class__.__name__, self.condition, self.if_true, self.if_false)
|
||||||
|
)
|
||||||
|
@ -484,6 +484,14 @@ class ObjectToArrayOperation(ArrayVar):
|
|||||||
"""
|
"""
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Get the hash of the operation.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The hash of the operation.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.value))
|
||||||
|
|
||||||
|
|
||||||
class ObjectKeysOperation(ObjectToArrayOperation):
|
class ObjectKeysOperation(ObjectToArrayOperation):
|
||||||
"""Operation to get the keys of an object."""
|
"""Operation to get the keys of an object."""
|
||||||
@ -645,6 +653,14 @@ class ObjectMergeOperation(ObjectVar):
|
|||||||
"""
|
"""
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Get the hash of the operation.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The hash of the operation.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.left, self.right))
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(
|
@dataclasses.dataclass(
|
||||||
eq=False,
|
eq=False,
|
||||||
@ -725,6 +741,14 @@ class ObjectItemOperation(ImmutableVar):
|
|||||||
"""
|
"""
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Get the hash of the operation.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The hash of the operation.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.value, self.key))
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(
|
@dataclasses.dataclass(
|
||||||
eq=False,
|
eq=False,
|
||||||
@ -799,6 +823,14 @@ class ToObjectOperation(ObjectVar):
|
|||||||
"""
|
"""
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Get the hash of the operation.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The hash of the operation.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self._original_var))
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(
|
@dataclasses.dataclass(
|
||||||
eq=False,
|
eq=False,
|
||||||
@ -876,3 +908,11 @@ class ObjectHasOwnProperty(BooleanVar):
|
|||||||
The VarData of the components and all of its children.
|
The VarData of the components and all of its children.
|
||||||
"""
|
"""
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Get the hash of the operation.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The hash of the operation.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.value, self.key))
|
||||||
|
@ -254,6 +254,14 @@ class StringToStringOperation(StringVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Calculate the hash value of the object.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
int: The hash value of the object.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.a))
|
||||||
|
|
||||||
|
|
||||||
class StringLowerOperation(StringToStringOperation):
|
class StringLowerOperation(StringToStringOperation):
|
||||||
"""Base class for immutable string vars that are the result of a string lower operation."""
|
"""Base class for immutable string vars that are the result of a string lower operation."""
|
||||||
@ -368,6 +376,14 @@ class StringContainsOperation(BooleanVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Calculate the hash value of the object.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
int: The hash value of the object.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.a, self.b))
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(
|
@dataclasses.dataclass(
|
||||||
eq=False,
|
eq=False,
|
||||||
@ -439,6 +455,14 @@ class StringItemOperation(StringVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Calculate the hash value of the object.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
int: The hash value of the object.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.a, self.i))
|
||||||
|
|
||||||
|
|
||||||
class ArrayJoinOperation(StringVar):
|
class ArrayJoinOperation(StringVar):
|
||||||
"""Base class for immutable string vars that are the result of an array join operation."""
|
"""Base class for immutable string vars that are the result of an array join operation."""
|
||||||
@ -505,6 +529,14 @@ class ArrayJoinOperation(StringVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Calculate the hash value of the object.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
int: The hash value of the object.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.a, self.b))
|
||||||
|
|
||||||
|
|
||||||
# Compile regex for finding reflex var tags.
|
# Compile regex for finding reflex var tags.
|
||||||
_decode_var_pattern_re = (
|
_decode_var_pattern_re = (
|
||||||
@ -722,6 +754,14 @@ class ConcatVarOperation(StringVar):
|
|||||||
"""Post-initialize the var."""
|
"""Post-initialize the var."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Get the hash of the var.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The hash of the var.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, *self._var_value))
|
||||||
|
|
||||||
|
|
||||||
ARRAY_VAR_TYPE = TypeVar("ARRAY_VAR_TYPE", bound=Union[List, Tuple, Set])
|
ARRAY_VAR_TYPE = TypeVar("ARRAY_VAR_TYPE", bound=Union[List, Tuple, Set])
|
||||||
|
|
||||||
@ -1144,6 +1184,14 @@ class StringSplitOperation(ArrayVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Get the hash of the var.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The hash of the var.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.a, self.b))
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(
|
@dataclasses.dataclass(
|
||||||
eq=False,
|
eq=False,
|
||||||
@ -1209,6 +1257,14 @@ class ArrayToArrayOperation(ArrayVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Get the hash of the var.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The hash of the var.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.a))
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(
|
@dataclasses.dataclass(
|
||||||
eq=False,
|
eq=False,
|
||||||
@ -1322,6 +1378,14 @@ class ArraySliceOperation(ArrayVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Get the hash of the var.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The hash of the var.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.a, self._slice))
|
||||||
|
|
||||||
|
|
||||||
class ArrayReverseOperation(ArrayToArrayOperation):
|
class ArrayReverseOperation(ArrayToArrayOperation):
|
||||||
"""Base class for immutable string vars that are the result of a string reverse operation."""
|
"""Base class for immutable string vars that are the result of a string reverse operation."""
|
||||||
@ -1399,6 +1463,14 @@ class ArrayToNumberOperation(NumberVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Get the hash of the var.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The hash of the var.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.a))
|
||||||
|
|
||||||
|
|
||||||
class ArrayLengthOperation(ArrayToNumberOperation):
|
class ArrayLengthOperation(ArrayToNumberOperation):
|
||||||
"""Base class for immutable number vars that are the result of an array length operation."""
|
"""Base class for immutable number vars that are the result of an array length operation."""
|
||||||
@ -1505,6 +1577,14 @@ class ArrayItemOperation(ImmutableVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Get the hash of the var.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The hash of the var.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.a, self.i))
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(
|
@dataclasses.dataclass(
|
||||||
eq=False,
|
eq=False,
|
||||||
@ -1595,6 +1675,14 @@ class RangeOperation(ArrayVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Get the hash of the var.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The hash of the var.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.start, self.end, self.step))
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(
|
@dataclasses.dataclass(
|
||||||
eq=False,
|
eq=False,
|
||||||
@ -1660,6 +1748,14 @@ class ArrayContainsOperation(BooleanVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Get the hash of the var.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The hash of the var.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.a, self.b))
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(
|
@dataclasses.dataclass(
|
||||||
eq=False,
|
eq=False,
|
||||||
@ -1728,6 +1824,14 @@ class ToStringOperation(StringVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Get the hash of the var.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The hash of the var.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.original_var))
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(
|
@dataclasses.dataclass(
|
||||||
eq=False,
|
eq=False,
|
||||||
@ -1800,6 +1904,14 @@ class ToArrayOperation(ArrayVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Get the hash of the var.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The hash of the var.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.original_var))
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(
|
@dataclasses.dataclass(
|
||||||
eq=False,
|
eq=False,
|
||||||
@ -1871,6 +1983,14 @@ class ArrayRepeatOperation(ArrayVar):
|
|||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Get the hash of the var.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The hash of the var.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.a, self.n))
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(
|
@dataclasses.dataclass(
|
||||||
eq=False,
|
eq=False,
|
||||||
@ -1936,3 +2056,11 @@ class ArrayConcatOperation(ArrayVar):
|
|||||||
|
|
||||||
def _get_all_var_data(self) -> ImmutableVarData | None:
|
def _get_all_var_data(self) -> ImmutableVarData | None:
|
||||||
return self._cached_get_all_var_data
|
return self._cached_get_all_var_data
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
"""Get the hash of the var.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
The hash of the var.
|
||||||
|
"""
|
||||||
|
return hash((self.__class__.__name__, self.a, self.b))
|
||||||
|
Loading…
Reference in New Issue
Block a user