builtin max() and weak ordering

Mark Dickinson dickinsm at gmail.com
Thu Mar 3 08:07:36 EST 2011


On Mar 3, 10:38 am, Stephen Evans <step... at recombinant.co.uk> wrote:
> The CPython builtins min() and max() both return the first satisfactory object found. This behaviour is undocumented. Examining the source in bltinmodule.c shows that min() and max() both result in a call to min_max() with Py_LT and Py_GT passed respectively.
>
> The behaviour of min() is correct. But with weak orderings of equivalent objects, surely max() should be using Py_GE ? (the converse of Py_LT). Should I be reporting a bug, submitting a patch, making feature request or suggesting a documentation update ?

See:

http://bugs.python.org/issue9802

(and feel free to add comments to that issue).

Mark



More information about the Python-list mailing list