Aahz <aahz@pythoncraft.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(): > pass > > 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 def f(): return permissions f.permissions = 'author' print f() Traceback (most recent call last): File "a.py", line 5, in ? print f() File "a.py", line 2, in f return permissions NameError: global name 'permissions' is not defined Regards, Martin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4