[EMAIL PROTECTED] writes:

> My code will have about 10 of these global objects, all of which
> interact with eachother. It seems silly to have to pass 10
> parameters around to each instance I work with.

Yes. A better solution would be to put them inside a module, and
import that module. Then the objects are available at any level as
attributes of the imported module.

===== foo.py =====
def spam():
    return max(eggs, ham)

eggs = 17
ham = 12
=====

===== bar.py =====
import foo

def main():
    spork = do_something_with(foo.eggs)
    foo.spam(spork)
=====

-- 
 \    "Know what I hate most? Rhetorical questions."  -- Henry N. Camp |
  `\                                                                   |
_o__)                                                                  |
Ben Finney

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to