擅长:python、mysql、java
<p>来自<a href="http://docs.python.org/library/stdtypes.html#comparisons" rel="nofollow">the docs</a>:</p>
<blockquote>
<p><strong>CPython implementation detail:</strong> Objects of different types except numbers are ordered by their type names; objects of the same types that don’t support proper comparison are ordered by their address.</p>
</blockquote>
<p><code>NoneType</code>比<code>int</code>小,因为比较似乎区分大小写。</p>
<pre><code>>>> type(0)
<type 'int'>
>>> type(None)
<type 'NoneType'>
>>> 'NoneType' < 'int'
True
</code></pre>