New names for some operations taylanbayirli@xxxxxx (13 Sep 2015 12:13 UTC)
Re: New names for some operations John Cowan (13 Sep 2015 19:01 UTC)
Re: New names for some operations taylanbayirli@xxxxxx (13 Sep 2015 20:19 UTC)
Re: New names for some operations John Cowan (13 Sep 2015 22:20 UTC)
Re: New names for some operations taylanbayirli@xxxxxx (14 Sep 2015 08:29 UTC)
Re: New names for some operations Shiro Kawai (13 Sep 2015 23:28 UTC)
Re: New names for some operations John Cowan (13 Sep 2015 23:45 UTC)
Re: New names for some operations Shiro Kawai (13 Sep 2015 19:27 UTC)
Re: New names for some operations taylanbayirli@xxxxxx (13 Sep 2015 20:04 UTC)
Re: New names for some operations John Cowan (13 Sep 2015 20:11 UTC)
Re: New names for some operations Shiro Kawai (13 Sep 2015 20:25 UTC)
Re: New names for some operations taylanbayirli@xxxxxx (13 Sep 2015 21:46 UTC)
Re: New names for some operations taylanbayirli@xxxxxx (14 Sep 2015 09:39 UTC)
Re: New names for some operations Arthur A. Gleckler (13 Sep 2015 19:42 UTC)
Re: New names for some operations taylanbayirli@xxxxxx (13 Sep 2015 19:57 UTC)
Re: New names for some operations Arthur A. Gleckler (14 Sep 2015 03:25 UTC)
Re: New names for some operations John Cowan (14 Sep 2015 03:38 UTC)

Re: New names for some operations John Cowan 14 Sep 2015 03:38 UTC

Arthur A. Gleckler scripsit:

> That won't get rid of many of the Heisenbugs since insertion order itself
> is likely to be effectively random in any system communicating with the
> outside world.

I don't think it's meant to.  Python ordered dictionaries handle certain
use cases well: for example, if you want to represent something like
a C struct by mapping a name to an offset, the ordered dictionary can
be made to guarantee that the offsets are in increasing order when the
dictionary is traversed.  For another example, ordered dictionaries
can be used as the internal representation of XML/HTML elements and
JSON objects, so that when the internal representation is printed out,
it uses the same order as when it was read in, avoiding unnecessary
discrepancies between the input and the output.

In CPython, ordered dictionaries are less efficient than ordinary
dictionaries.  In PyPy, they are about equally efficient, so PyPy uses
ordered dictionaries in all cases.  Note that if the value associated
with an existing key changes, the ordering of the association within
the dictionary remains unchanged.

--
John Cowan          http://www.ccil.org/~cowan        xxxxxx@ccil.org
If I have seen farther than others, it is because they are closer than
I am. --Noetica
Noetica’s standing on the shoulders of galahs.  --Gibbon
Better than standing on the shoulders of hobyahs (not to be confused
with hobbits, though some have done so).  --me