On Thu, Sep 5, 2013 at 6:19 PM, William ML Leslie <[email protected]> wrote: > On 5 September 2013 17:07, Javier Candeira <[email protected]> wrote: >> Just one thing. Comparability is transitive, so I don't have to test >> comparability of the new element with all existing elements. I only >> have to check whether it's comparable to the first or root item in the >> structure. So that test is O(1), not O(n). > > Well, you hope that comparability is transitive. In python 2, *order* > wasn't even transitive between the provided numeric types: both > decimal and float would order correctly with respect to int, but not > with respect to each other.
Good point, and great history lesson. However, that is a serious bug in the implementation in the provided numeric types, not in the sorted list implementation. Some expectations are reasonable. J _______________________________________________ melbourne-pug mailing list [email protected] https://mail.python.org/mailman/listinfo/melbourne-pug
