help: Unit test fixture returning the same object

Peter Hansen peter at engcorp.com
Wed Aug 4 13:19:04 EDT 2004


Michael McCracken wrote:

> So, I'm still surprised that id() would point to the same object every
> time, but I'm willing to believe it. 

Don't think of it using those words.  Think of it as "the new
object is being created at the same address as the old object
was at, so it's likely the first object created since the old
one was destroyed", or something like that.   At least that way
it's much easier to believe, much less of a coincidence, and
actually something that a number of people have encountered
over the years, though often with similar expressions of surprise
or disbelief. :-)

-Peter



More information about the Python-list mailing list