26 Jun
2006
26 Jun
'06
8:55 p.m.
On Monday 26 June 2006 13:55, Robert Gravina wrote:
By the way, what is an id() comparison? As far as I know Python compares to see if the instances (i.e. memory locations) are equal.
You got your chocolate in my peanutbutter! An "id()" comparison would be, "id(this) == id(that)". In most (all?) implementations, 'id()' returns the memory location, but this is an implementation detail that is not guaranteed and shouldn't be depended on. An object's python id is to be treated as an opaque identifier. Mike.