overload equals to special case immutable var
This commit is contained in:
parent
5bfc0c0446
commit
0fd423712b
@ -765,6 +765,16 @@ class Var:
|
|||||||
Returns:
|
Returns:
|
||||||
Whether the vars are equal.
|
Whether the vars are equal.
|
||||||
"""
|
"""
|
||||||
|
from reflex.ivars import ImmutableVar
|
||||||
|
|
||||||
|
if isinstance(other, ImmutableVar) or isinstance(self, ImmutableVar):
|
||||||
|
return (
|
||||||
|
self._var_name == other._var_name
|
||||||
|
and self._var_type == other._var_type
|
||||||
|
and ImmutableVarData.merge(self._var_data)
|
||||||
|
== ImmutableVarData.merge(other._var_data)
|
||||||
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
self._var_name == other._var_name
|
self._var_name == other._var_name
|
||||||
and self._var_type == other._var_type
|
and self._var_type == other._var_type
|
||||||
|
Loading…
Reference in New Issue
Block a user