[Zope-dev] I need more eyes

Michel Pelletier michel@digicool.com
Wed, 14 Apr 1999 16:18:23 -0400


> -----Original Message-----
> From: Mike Pelletier [mailto:mike@compar.com]
> Sent: Wednesday, April 14, 1999 3:47 PM
> To: zope-dev@zope.org
> Subject: [Zope-dev] I need more eyes
> 
> 
> >>> from Main import app
> >>> hg = app.devel.hg
> >>> list = hg.entries.values()
> >>> user = hg.users['Mike']
> 
>     list is now a list of "A" type object, and user is now 
> the "B" type
> object in question.
> 
> >>> print list[0].user, user
> <User instance at 0x8444100> <User instance at 0x8444100>
> 
>     By eyeball (and design), they are the same object.
> 
> >>> print list[0].user == user
> 0
> >>> print list[0].user != user
> 1
> 
>     Python, however, disagrees!  How can two objects occupy 
> the same location
> in memory, and not be judged equal by Python? 


This is a *guess* cuz I can't take the time to reproduce a similar
situation, but i believe hg.entries.values() returns a bunch of
Acquistion wrapped user objects.  Try:

>>> print list[0].aq_base.user == user

-The Other Michel (Mike) Pelletier