python is, ==区别

“is” is the identity comparison. #比较引用是否相同

“==” is the equality comparison. #比较内容是否相同

>>> [] is []
False
>>> [] == []
True

 


posted @ 2018-05-28 14:49  YYRise  阅读(157)  评论(0编辑  收藏  举报