<br><br><div class="gmail_quote">On Tue, Nov 11, 2008 at 2:00 PM, Greg Ewing <span dir="ltr">&lt;<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>&gt;</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 &quot;n/a&quot; (or &quot;missing&quot;, or &quot;undefined&quot;) imply &quot;smaller than<br>
everything else&quot;?<br>
</blockquote>
<br>
It&#39;s just a convention based on viewing None as &quot;nothing&quot; 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&nbsp;</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&#39;m fine with that. Note that this works with strings today:</div>
<div><br></div><div>x = &quot;abc&quot;&nbsp;</div><div>y = &quot;abcd&quot;</div><div>x &lt; 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) &lt; C(a=2) &lt; C(a=2, b=3)</div><div><br></div><div>I understand why you don&#39;t want to make None comparison work generally for the &lt; operator.</div><div><br></div><div>--- Bruce</div></div>