ethical questions about global variables

rurpy at yahoo.com rurpy at yahoo.com
Tue Dec 16 07:22:44 CET 2008


On Dec 15, 11:00 pm, ru... at yahoo.com wrote:
> #my_module
> class Config: pass
> config = Config()
>
> def func1(state):
>     config.A = 1
> def func2(state)
>     config.A = 2
> def func3(state)
>     print config.A

That of course should have been:

def func1(config):
    config.A = 1
def func2(config)
    config.A = 2
def func3(config)
    print config.A



More information about the Python-list mailing list