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

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

猜你喜欢

转载自www.cnblogs.com/sea-stream/p/9978145.html