Hello, I recently ran into some issues with IronPython's heapq implementation whereby code that functions correctly on CPython failed with IronPython 2.6. The issue is that the CPython implementation of heapq only calls __le__() and __eq__() on the heap elements whereas the IronPython implementation calls __le__(), __eq__() *and* __gt__(). Although it seems that IronPython is well within specification to do so, there are some statements in the Python documentation that only __le__() will be used for sorting. Of course, it's arguable whether 'sorting' applies to heapq and indeed other similar algorithms or containers which rely on a defined ordering.
In any case, this is an avoidable difference between CPython and IronPython which tripped me up. I'm not sure whether the correct fix - if one is needed at all - is to IronPython's heapq implementation, to CPythons documentation, or to both. I wrote a little more about the issue here: < http://www.smallshire.org.uk/sufficientlysmall/2011/03/12/specification-of-rich-comparison-protocol-use-by-the-python-standard-library/ > Rob
_______________________________________________ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com