
Aahz Maruch wrote:
...
No, but it will have global, global objects. Any time one creates an object in Python, it has the potential to be bound to any name. Consider the module foo with attribute bar; foo.bar can be set at any time in any scope to any other object existing somewhere in Python's heap.
Right, but what language is otherwise? In what language are variables in one module firewalled from others so that references can't go back and forth? Only functional languages and perhaps security-constrained languages like JavaScript.
.... And that change will be visible everwhere that the name foo.bar is visible. It gets even trickier with multiple threads created in a single module namespace combined with mutable objects and global names (as I illustrated in my response to Dan). ...
I don't see that as having much to do with "globality." Python objects are shared between threads including the module object and the dictionary of module objects. But variables in Python are seldom global in the sense of C's extern or Perl's default scope. -- Take a recipe. Leave a recipe. Python Cookbook! http://www.ActiveState.com/pythoncookbook