I want to set a object in module be readonly and shared in common. Like follow situation:
# configure.py
with open("config.yaml","r") as f:
config = yaml.load(f)
and configure.py
will be used by other scripts. The config object shoud be readonly and fixed.
# data.py
from configure import config
some_operation( config )
# ....
# main.py
from configure import config
config["attr"] = "erroneously_setting"
some_operation( config )
I worry that config object would be erroneously modified by other scripts.
Could I set a variable readonly ?