On Mon, Jul 12, 2010 at 4:09 PM, éæå
<onpon4@xxxxxxxxx> wrote:
(I ask because it seems like doing what you are doing would be a big
ol' error prone hassle and waste of your time compared to other more
commonly used techniques in python, but I can't figure out exactly what
problem that dictionary approach was originally conceived of as a
solution for)
Simple: I needed instances to be able to reference themselves, and I didn't feel like generating my own unique IDs and passing them on as a parameter. :)
Why are you storing stuff by id() in a dictionary in the first place?
When would you want to look something up by it's id() when you wouldn't
want just to have a reference (possible a weakref) to the object itself?