reflex 0.5.1a1__py3-none-any.whl → 0.5.1a2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of reflex might be problematic. Click here for more details.

@@ -1,7 +1,8 @@
1
1
  """Create a list of components from an iterable."""
2
+
2
3
  from __future__ import annotations
3
4
 
4
- from typing import Any, Dict, Optional, overload
5
+ from typing import Any, Dict, Optional, Union, overload
5
6
 
6
7
  from reflex.components.base.fragment import Fragment
7
8
  from reflex.components.component import BaseComponent, Component, MemoizationLeaf
@@ -10,7 +11,7 @@ from reflex.constants import Dirs
10
11
  from reflex.constants.colors import Color
11
12
  from reflex.style import LIGHT_COLOR_MODE, color_mode
12
13
  from reflex.utils import format, imports
13
- from reflex.vars import BaseVar, Var, VarData
14
+ from reflex.vars import Var, VarData
14
15
 
15
16
  _IS_TRUE_IMPORT = {
16
17
  f"/{Dirs.STATE_PATH}": [imports.ImportVar(tag="isTrue")],
@@ -171,6 +172,11 @@ def cond(condition: Any, c1: Any, c2: Any = None):
171
172
  c2 = create_var(c2)
172
173
  var_datas.extend([c1._var_data, c2._var_data])
173
174
 
175
+ c1_type = c1._var_type if isinstance(c1, Var) else type(c1)
176
+ c2_type = c2._var_type if isinstance(c2, Var) else type(c2)
177
+
178
+ var_type = c1_type if c1_type == c2_type else Union[c1_type, c2_type]
179
+
174
180
  # Create the conditional var.
175
181
  return cond_var._replace(
176
182
  _var_name=format.format_cond(
@@ -179,7 +185,7 @@ def cond(condition: Any, c1: Any, c2: Any = None):
179
185
  false_value=c2,
180
186
  is_prop=True,
181
187
  ),
182
- _var_type=c1._var_type if isinstance(c1, BaseVar) else type(c1),
188
+ _var_type=var_type,
183
189
  _var_is_local=False,
184
190
  _var_full_name_needs_state_prefix=False,
185
191
  merge_var_data=VarData.merge(*var_datas),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: reflex
3
- Version: 0.5.1a1
3
+ Version: 0.5.1a2
4
4
  Summary: Web apps in pure Python.
5
5
  Home-page: https://reflex.dev
6
6
  License: Apache-2.0
@@ -240,7 +240,7 @@ reflex/components/core/banner.pyi,sha256=Su21s78LOsIyYy3n7rtBeYDgXl2PO2Oo9cMAztP
240
240
  reflex/components/core/client_side_routing.py,sha256=mdZsGuc1V9qvOE0TaLEnXmXo0qHuPjc_dZrSjnlZsqc,1873
241
241
  reflex/components/core/client_side_routing.pyi,sha256=7Zel95b6tqfW0ulIJEHh9fmG_6av9eNeNjtORZ73jjM,6264
242
242
  reflex/components/core/colors.py,sha256=-hzVGLEq3TiqroqzMi_YzGBCPXMvkNsen3pS_NzIQNk,590
243
- reflex/components/core/cond.py,sha256=YwFrRdf9oDJyLhnPbFg73IlAWKy8yWCeIfTBMt9GtwY,6005
243
+ reflex/components/core/cond.py,sha256=4jKcg9IBprpWAGY28Iymxe5Pu0UMEH-2e64zIkmf7_w,6163
244
244
  reflex/components/core/debounce.py,sha256=HUR2yHkWEFawc64GZ7CakzLCx6WwCRhiPssAGJbtkSY,4820
245
245
  reflex/components/core/debounce.pyi,sha256=VGBX3hsRQo3xFP0xkYJuy25rDQ5rxRIk58mCV34fHSI,4216
246
246
  reflex/components/core/foreach.py,sha256=utMZhwg_k118EFwvO5jLXeQylZS3AAKS38fAIG9N2wE,4732
@@ -516,8 +516,8 @@ reflex/utils/types.py,sha256=1CJQsNf2wMrMJi-3th7eELZ3MFOFUBgoIs3j5rU-MNE,15152
516
516
  reflex/utils/watch.py,sha256=HzGrHQIZ_62Di0BO46kd2AZktNA3A6nFIBuf8c6ip30,2609
517
517
  reflex/vars.py,sha256=MlooFk2EYY-1FeaJOSDovBWKGiEhVgR9Nrk_feid0FI,69074
518
518
  reflex/vars.pyi,sha256=p7rrP7ZcV0KN26a8LSqjTWP7IzZXXSee0H9Rl4fjEtg,5753
519
- reflex-0.5.1a1.dist-info/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
520
- reflex-0.5.1a1.dist-info/METADATA,sha256=nACMw97nVC4Ul_sdvuZ4SWba1QLSUhsuRFCRjrCFRUw,12089
521
- reflex-0.5.1a1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
522
- reflex-0.5.1a1.dist-info/entry_points.txt,sha256=H1Z5Yat_xJfy0dRT1Frk2PkO_p41Xy7fCKlj4FcdL9o,44
523
- reflex-0.5.1a1.dist-info/RECORD,,
519
+ reflex-0.5.1a2.dist-info/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
520
+ reflex-0.5.1a2.dist-info/METADATA,sha256=Aau26V-BiSytdYK0wmFJxHQG9N6EmXtzf2VLuKb-MPg,12089
521
+ reflex-0.5.1a2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
522
+ reflex-0.5.1a2.dist-info/entry_points.txt,sha256=H1Z5Yat_xJfy0dRT1Frk2PkO_p41Xy7fCKlj4FcdL9o,44
523
+ reflex-0.5.1a2.dist-info/RECORD,,