class VariableHolder: def __setattr__(self, name, value): self.__dict__[name] = value def __getattr__(self, name): return self.__dict__.get(name, None) global_variables = VariableHolder()