Hi all, I've now spoken with several developers about the object identity that arises out of hte new dict strategies, and all seem to think that the current implementation breaks Python's semantics, that is:
x = 3 z = {x: None} assert next(iter(z)) is x will fail. The only solution I see to this that maintains the correct semantics in all cases is to specialize is/id() for primitive types. That is to say, all integers of any given value have the same id() and x is y is true. Doing x is y is true is easy, you simply have a multimethod which dispatches on the types and compares intval for W_IntObjects (objects of differing types can never have the same identity) however the question is what to use for id() that is unique, never changes for an int, and doesn't intersect with any other live object. In particular the last constraint is the most difficult I think. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." -- Evelyn Beatrice Hall (summarizing Voltaire) "The people's good is the highest law." -- Cicero
_______________________________________________ pypy-dev mailing list pypy-dev@python.org http://mail.python.org/mailman/listinfo/pypy-dev