En Sun, 20 May 2007 22:19:01 -0300, Ian Clark <[EMAIL PROTECTED]> escribió:
> On 5/20/07, Michael Hoffman <[EMAIL PROTECTED]> wrote: >> [snip] >> That's not what I get: > > That's because you didn't have 'del a'. > > Now I tried this in the shell and got different id's for a and b, but > when I typed it into a file and ran from there the id's where always > the same. Must have something to do with other programs allocating > space faster than I can type everything out (I do have a few processes > going). Interesting. The point is, as id() is related to the object memory address, and memory may be reused, two objects (*NOT* simultaneously alive!!!) may return the same id(). Perhaps in some circunstances it's easier to show than in others, but it happens, so unless one is absolutely sure that the object is still alive, going back from its id to the original object is dangerous. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list