Unable to update Python dicts from JS

Thanks Duncan. In my original usecase it’s because I’m trying to avoid a memory leak in Skulpt when returning strings/dicts from Python. If it interests you, the full story is in the bug topic here: Anvil JS - memory leak when returning data from JS, Python dicts aren't updated . It was suggested I open a separate topic only for the dict update issue.

So let’s assume for now the Javascript function is indeed necessary, and that the randomizer isn’t relevant. Rather, focus on the fact the JS function’s updates aren’t reflected in the Python dict and how to handle that, if possible.