"Is" is "is" [was: any way to customize the is operator?]
Terry Reedy
tjreedy at udel.edu
Sat Feb 11 16:12:07 EST 2006
"> Lonnie Princehouse wrote:
>> Calling the wrapped version of this function from Python will produce a
>> Python wrapper which represents the same underlying C++ object, but is
>> not actually the same Python object:
What I think you need is a custom version of the .__eq__ (self,other)
method that pierces thru the wrappers to compare the underlying C++
objects. Then test a == b.
In Python, 'is' specifically means identity of Python objects.
More information about the Python-list
mailing list