On 11/26/05, Noam Raphael <[EMAIL PROTECTED]> wrote: > [...stuff about using Ref() for identity dictionaries...]
I too have thought along these lines, but I went one step further. There is an existing function that could be modified to produce Ref objects: id(). Making id() into a type allows it force unsignedness, incorporate a method for easy printing, maintain a reference to the target so that "id(x.foo) == id(x.bar)" doesn't risk reusing the same id.. and the id object would be the same size as an int object is today. I don't see any disadvantage, except perhaps code that assumes id() returns an int. That could be fixed by having id() subclass int for a few versions while we transition, although that may require we store the pointer seperate from the integer value. id() would be usable in dicts as a value, behaving as Noam suggests that Ref behave. Kills two birds with one stone. -- Adam Olsen, aka Rhamphoryncus _______________________________________________ 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