1
yishenggudou 2013-03-01 19:02:02 +08:00
比较对象
|
2
ThunderEX OP @yishenggudou 不是有is了么?
|
3
dreampuf 2013-03-01 19:09:37 +08:00
http://docs.python.org/2/library/functions.html#id
http://stackoverflow.com/questions/3402679/identifying-objects-why-does-the-returned-value-from-id-change 接着SO的链接 In [1]: a = 5 In [2]: id(a) Out[2]: 140615773913304 In [3]: b = 5 In [4]: id(b) Out[4]: 140615773913304 In [5]: a = 100005 In [6]: id(a) Out[6]: 140615774390544 In [7]: b = 100005 In [8]: id(b) Out[8]: 140615774253864 |
4
phuslu 2013-03-01 19:09:53 +08:00 via iPhone
的确没啥用,目前我用到的地方也就是 id(gevent.getcurrent()) 的返回值「充当」 thread id用。
|