> overhead pays when it's used as a namespace. Both "lookdict_namespace" > and "lookdict_string" will fall back to a "lookdict" dictionary when a > non-string key is inserted. Until reading this sentence, I had never thought of doing something so bizarre as adding a non-string key to a namespace (via the 'backdoor' .__dict__ reference). But it currently works. >>> import __main__ >>> __main__.__dict__[1]='x' >>> dir() [1, '__builtins__', '__doc__', '__main__', '__name__', 'x'] However, since the implementation of namespaces is an implementation detail, and since I can (as yet) see no need for the above (except to astound and amaze), I think you (and Guido) should feel free to disallow this, especially if doing so facilitates speed improvements. Terry J. Reedy
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