Avaiga/taipy-gui

BUG-Issue with on_change when variables are imported with *

FlorianJacta opened this issue · 1 comments

Description
When variables are imported with * from another module, these variables won't be updated appropriately in on_change. This only happens when it is imported with * and not with the name of the variables

How to reproduce

This will show this when passing in the on_change:

None None s t

main.py

from taipy import Gui
from other_module import *

def on_change(state, var_name, var_value):
    print(state.s, state.d, var_name, var_value)

Gui(page).run()

Other module

from taipy.gui import Markdown

s = None

page = Markdown("<|{s}|selector|lov=t;L;d|>")

If from other_module import * is changed to this from other_module import page, s, there is no issue.

Expected behavior
state.s should reflect the correct value of s.

Runtime environment
Taipy 3.0 Develop

I updated the priority of this ticket because it s blocking a PR on templates.