<br><br><div class="gmail_quote">On Tue, Nov 11, 2008 at 2:00 PM, Greg Ewing <span dir="ltr"><<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
M.-A. Lemburg wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="Ih2E3d">
On 2008-11-11 14:28, Antoine Pitrou wrote:<br>
<br>
</div><div class="Ih2E3d"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
But why should "n/a" (or "missing", or "undefined") imply "smaller than<br>
everything else"?<br>
</blockquote>
<br>
It's just a convention based on viewing None as "nothing" or the<br>
empty set.<br>
</div></blockquote>
<br>
It would be possible to implement this convention in the<br>
sort method, without making it a feature of comparisons<br>
in general.<br></blockquote><div><br></div><div>+1 </div><div><br></div><div>None / Missing / undefined should be able to be sorted with other data. If this requires adding an optional parameter to sort, I'm fine with that. Note that this works with strings today:</div>
<div><br></div><div>x = "abc" </div><div>y = "abcd"</div><div>x < y</div><div><br></div><div>note that x[3] is undefined and the comparison operator (and sorting) automatically places x before y when all other elements of x and y are equal. Likewise if I created a comparison method for a class I would probably order</div>
<div><br></div><div>C(a=1) < C(a=2) < C(a=2, b=3)</div><div><br></div><div>I understand why you don't want to make None comparison work generally for the < operator.</div><div><br></div><div>--- Bruce</div></div>