[Python-ideas] Putting `blist` into collections module

random832 at fastmail.us random832 at fastmail.us
Mon Sep 22 20:48:02 CEST 2014


On Sun, Sep 21, 2014, at 01:18, David Wilson wrote:
> Coming from this perspective, I'd prefer that further additions were
> limited to clean and far better understood structures. In this light,
> could we perhaps instead discuss the merits of a collections.Tree,
> collections.SortedDict or similar?

As I understand it, the problem with a tree, SortedDict/SortedSet, or in
general any collection that relies on comparison relationships (heap,
etc), is: unlike hashing (where Hashable implies an immutable hash
relationship), there is no way to detect whether an object implements an
immutable well-defined ordering. And that, unlike a mutable hashed
object (which can AIUI only lose itself), a mutable sorted object (or a
badly-behaved one like NaN) can cause other objects in the set to be
inserted in the wrong place or not found.


More information about the Python-ideas mailing list