Python None 陷阱

None < 0
>>TRUE

None<[]
>>TRUE

None<{}
>>TRUE
首先,在Python3中,已经不允许跨类型比较了。
None is the "lowest type" in Python 2, so None is always lower than any int which is always lower than any str etc
在Python2中,None < int < str 。

posted @ 2016-08-10 13:12  ohword  阅读(141)  评论(0)    收藏  举报