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/2012-February/116129.html below:

[Python-Dev] A new dictionary implementation

[Python-Dev] A new dictionary implementation [Python-Dev] A new dictionary implementationMark Shannon mark at hotpy.org
Thu Feb 2 20:17:16 CET 2012
Just a quick update.

I've been analysing and profile the behaviour of my new dict and messing 
about with various implementation options.

I've settled on a new implementation.
Its the same basic idea, but with better locality of reference for 
unshared keys.

Guido asked:

 > Another question: a common pattern is to use (immutable) class
 > variables as default values for instance variables, and only set the
 > instance variables once they need to be different. Does such a class
 > benefit from your improvement?

For those instances which keep the default, yes.
Otherwise the answer is, as Martin pointed out,
it could yes provided that adding a new key does not force a resize.
Although it is a bit arbitrary when a resize occurs.
The new version will incorporate this behaviour.

Expect version 2 soon.

Cheers,
Mark.
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