Martin v. Loewis
01 Apr 2002 10:00:04 +0200
Aahz <email@example.com> writes:
> Well, no. First-level names, yes, but each object itself is a
> namespace, so every name will be bound to an object that can contain
> names. To use my favorite example:
> def f():
> f.permissions = 'author'
Except that those are not names, they are attributes. Namespaces nest,
in Python; permissions does not live in namespace, which becomes
obvious if you try to nest it
f.permissions = 'author'
Traceback (most recent call last):
File "a.py", line 5, in ?
File "a.py", line 2, in f
NameError: global name 'permissions' is not defined