What's the thing with global variables?
From what I've tried, using the global variables like this
works when you just run your code, but doesn't work in compiled executables. I've seen some folks mentioning this here on this server, but I can't seem to find any relevant docs on this, as well as I don't understand whether it's a bug, or am I supposed to work with global variables somehow differently. Any info on this would help, thanks!
4 Replies
They’ve said that it results in undefined behavior, so it’s not really supported at this time. Hopefully soon! You can define top level constants using alias though
Ah, ok, thanks for the clarification!
Is there a bug for this or something else where I coud track the progress on this (assuming it's planned)?
GitHub
Global variables are not fully supported · Issue #1573 · modularml/...
Bug description run this code: from python import Python var mod_global :PythonObject = None fn main() raises: let mod_xml : PythonObject = Python.import_module("lxml") # let mod_global :...
great, thanks!