[Python-Dev] More compact dictionaries with faster iteration (original) (raw)

fwierzbicki at gmail.com fwierzbicki at gmail.com
Tue Dec 11 00:21:37 CET 2012


On Mon, Dec 10, 2012 at 3:13 PM, fwierzbicki at gmail.com <fwierzbicki at gmail.com> wrote:

On Mon, Dec 10, 2012 at 10:01 AM, Armin Rigo <arigo at tunes.org> wrote:

Technically, I could see Python switching to ordered dictionaries everywhere. Raymond's insight suddenly makes it easy for CPython and PyPy, and at least Jython could use the LinkedHashMap class (although this would need checking with Jython guys). I honestly hope this doesn't happen - we use ConcurrentHashMap for our dictionaries (which lack ordering) and I'm sure getting it to preserve insertion order would cost us. I just found this http://code.google.com/p/concurrentlinkedhashmap/ so maybe it wouldn't be all that bad. I still personally like the idea of leaving basic dict order undetermined (there is already an OrderedDict if you need it right?) But if ConcurrentLinkedHashMap is as good as is suggested on that page then Jython doesn't need to be the thing that blocks the argument.

-Frank



More information about the Python-Dev mailing list