Le Mon, 6 May 2013 23:18:54 +1000, Nick Coghlan <ncogh...@gmail.com> a écrit : > > IIRC, Jython just delays calculating the object id() until it is > called, and lives with it potentially being incredibly expensive to > calculate. Is there some way PyPy can run with a model where "is" is > defined in terms of values for immutable objects, with a lazily > populated mapping from values to numeric ids if you're forced to > define them through an explicit call to id()?
This sounds reasonable. Actually, for small ints, id() could simply be a tagged pointer (e.g. "1 + 2 * myint.value"). > We're not going to change the language design because people don't > understand the difference between "is" and "==" and then wrongly blame > PyPy for breaking their code. Well, if I'm doing: mylist = [x] and ``mylist[0] is x`` returns False, then I pretty much consider the Python implementation to be broken, not my code :-) Regards Antoine. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com