A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2007-December/075527.html below:

[Python-Dev] Non-string keys in namespace dicts

[Python-Dev] Non-string keys in namespace dicts [Python-Dev] Non-string keys in namespace dictsPhillip J. Eby pje at telecommunity.com
Mon Dec 3 03:28:18 CET 2007
At 08:09 PM 12/1/2007 -0700, Neil Toronto wrote:
>Are there any use-cases for allowing namespace dicts (such as globals,
>builtins and classes) to have non-string keys?

Yes.  See http://pypi.python.org/pypi/AddOns


>  I'm asking because I'm
>planning on accelerating method lookups next, and the possibility of a
>key compare changing the underlying dict could be a major pain. (It was
>a minor pain for globals.)

For what it's worth, the AddOns package recommends the use of 
instances of built-in types (or tuples thereof) as add-on keys, so 
they would not have that problem in normal use.

I don't see a problem with requiring dictionary key comparisons to be 
side-effect-free - even in the general case of dictionaries, not just 
namespace ones.

More information about the Python-Dev mailing list

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