Tres Seaver wrote:
Nikhil N wrote:
Hmm, very strange.  I just did:

I used:

$ workingenv aq
$ source aq/bin/activate
$ easy_install Acquisition
$ python

For both Python 2.4 and 2.5 and can reproduce the problem.

 >>> from ExtensionClass import Base
 >>> from Acquisition import Implicit
 >>> class B(Base):
 ...     color = 'red'
 >>> class A(Implicit):
 ...     pass
 >>> b = B()
 >>> c = A()
 >>> c.color
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 AttributeError: color
 >>> b.c = c
 >>> b.c.color
 >>> b.c == c

When I do:

>>> b.c.aq_base == c

So the AQ-wrapper doesn't compare equal to the outermost part of the AQ chain anymore.

which is what you reported.  However, two wrappers constructed
separately do compare equal:

 >>> a = A().__of__(b)
 >>> a.color
 >>> b.a = a
 >>> b.a == a

Two wrappers compare equal, so the code comparing an AQ wrapper with something different should be the one with the problem. I'd look into Wrapper_compare in _Acquisition.c.

The Python 2.5 release notes don't talk about any changes to comparison
slots for C extensions: I'm not sure what could have changed.

No idea either :(


Zope-Dev maillist  -
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to