[Twisted-Python] Re: can pb.Copyable objects be compared for equality after a round trip?

Mike Pelletier mike at mkp.ca
Mon Jun 26 14:55:06 EDT 2006


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.




More information about the Twisted-Python mailing list