A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2003-January/032167.html below:

[Python-Dev] Re: Re: PEP 267 improvement idea

[Python-Dev] Re: Re: PEP 267 improvement ideaTerry Reedy tjreedy@udel.edu
Tue, 14 Jan 2003 13:44:37 -0500
> 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