[Tim] >So it's possible there for one of these be true: > > id(x) == id(y) and x is not y > id(x) != id(x) > >? Yes, the first. d = {} cnt = 0 for i in xrange(100000): s = "test" + `i` j = id(s) if d.has_key(j): cnt = cnt + 1 d[j] = s print cnt, "failures" Will print 500+ failures when run by JPython & JDK1.3 on win2k. >Then that's a bug in JPython or hotspot. Know which? JPython. > Filed a bug report? Years ago <wink>: http://www.python.org/jpython-bugs/incoming?id=118 >In CPython, we just use the address of an object's header, and as CPython >never moves an object's header in memory, the good stuff follows trivially. >Don't know what JPython tries to do, but it's bound to be harder there (as >Java can move memory around). That is also my guess. I cannot see what we can do about it, except inform users that not all python platform behave exactly the same. Which is why I brought it up. regards, finn
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4