nil 作比较时应该加上双引号 "

 

> type(X)
nil
> type(X)==nil
false
> type(X)=="nil"
true
> 

 

posted @ 2018-11-18 15:46  anobscureretreat  阅读(309)  评论(0编辑  收藏  举报