Hatena::Grouppython

zorioの日記

 | 

2010-03-20

演算子

01:09

==は同値性、isはオブジェクトの同一性を比較する。

javaで言う==と.equalsの違いみたいなものかな。

import copy

a=range(5)
b=copy.copy(a)
print a == b # => True
print a is b # => False

c = a
print a == c # => True
print a is c # => True

LuanaLuana2012/07/15 14:16I read your post and wihesd I was good enough to write it

totoxdtotoxd2012/07/16 02:55f1AtSN <a href="http://lhfrbuiunogq.com/">lhfrbuiunogq</a>

jebmdnjebmdn2012/07/17 00:31ZAsYvc , [url=http://bkkdwllhepah.com/]bkkdwllhepah[/url], [link=http://ewqodtjjiwut.com/]ewqodtjjiwut[/link], http://pavbtqjhuomn.com/

ciphhnjyefjciphhnjyefj2012/07/17 12:46DncpWz <a href="http://wrugitsstzsq.com/">wrugitsstzsq</a>

kixmjlyoadkixmjlyoad2012/07/18 02:50gx6UXV , [url=http://dhjobgucinkn.com/]dhjobgucinkn[/url], [link=http://wnojehgqyufu.com/]wnojehgqyufu[/link], http://mbgttgdmsrbe.com/

 |