why functions in modules need 'global foo' for integer foo but not dictionary foo?

seberino at spawar.navy.mil seberino at spawar.navy.mil
Fri Jul 29 01:58:16 EDT 2005


At top of a module I have an integer like so...

foo = 4

In a function in that module I know I need to do 'global foo' to get at
the value 4.
...

IIRC, for dictionaries you DO NOT have this issue?

Why this scope problem with integers but not dictionaries?

Chris




More information about the Python-list mailing list