New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot change variable defined in "__init__.py" after importing #47179
Comments
How can I change a variable that I defined in "__init__.py" of a Example: from common.var import *
var.fileList = [ "bla", "blub" ] So that the change of the value of "fileList" is seen when reading it But when the variable is defined inside "__init_.py" then the importing from common import *
fileList = [ "bla", "blub" ] And it cannot access it by writing: from common import *
common.fileList = [ "bla", "blub" ] Why are variables of "__init__.py" module non-modifyable this way and |
Use import common
common.fileList = ... Please ask further question on python-list (comp.lang.python) -- this is |
Oh yes, I am sorry, I forgot to tell you that I *cannot* change the Of course you are right that I am not strictly speaking about a bug but One solution in my situation could be that I could re-import the Maybe you can give me a reason for your opinion? |
As I said, please consult the newsgroup/mailing list for these |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: