<div dir="ltr"><div>On Sun, Dec 3, 2017 at 6:06 PM, Chris Barker <span dir="ltr"><<a href="mailto:chris.barker@noaa.gov" target="_blank">chris.barker@noaa.gov</a>></span> wrote: <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">In fact, it's striking me that there may well be classes that are 
defining the comparison magic methods not because they want the objects 
to "work" with the comparison operators, but because that want them to 
work with sort and min, and max, and...<br></blockquote><br>An existence proof: in NLTK, an <span style="font-family:monospace,monospace">__lt__</span> method added purely to facilitate consistent sorting (in doctests) of structured data objects for which comparison operators do not really make conceptual sense: <a href="https://github.com/nltk/nltk/pull/1902/files#diff-454368f06fd635b1e06c9bb6d65bd19bR689">https://github.com/nltk/nltk/pull/1902/files#diff-454368f06fd635b1e06c9bb6d65bd19bR689</a><br><div class="gmail_extra"><br></div><div class="gmail_extra">Granted, calling <span style="font-family:monospace,monospace">min()</span> and <span style="font-family:monospace,monospace">max()</span> on collections of these objects would not make conceptual sense either. Still, <span style="font-family:monospace,monospace">__sort_key__</span> would have been cleaner than <span style="font-family:monospace,monospace">__lt__</span>.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Cheers,</div><div class="gmail_extra">Nathan<br></div><div class="gmail_extra"></div></div>