[ZCM] [ZC] 578/ 2 Comment "ImplicitAcquisitionWrapper claim to be callable() but are not callable"

Collector: Zope Bugs, Features, and Patches ... zope-coders@zope.org
Wed, 20 Nov 2002 11:53:23 -0500


Issue #578 Update (Comment) "ImplicitAcquisitionWrapper claim to be callable() but are not callable"
 Status Pending, Zope/bug medium
To followup, visit:
  http://collector.zope.org/Zope/578

==============================================================
= Comment - Entry #2 by stevea on Nov 20, 2002 11:53 am

This is a limitation with wrapper / proxy kinds of things in Python.

The solution we use in Zope 3 is to use a different wrapper class if the thing being wrapped is callable. This different wrapper class declares itself callable. The default wrapper class does not.

I don't think this could be made to work for Zope 2 because of the extra complexities of acquisition -- a __call__ method could be acquired from anywhere.

I'd resolve this issue as a "Won't fix" or "broken as designed" ;-)

I'll let someone else actually close this issue, though.
________________________________________
= Request - Entry #1 by ajung on Sep 20, 2002 11:53 am

The CMF portal_catalog passes sometimes an ImplicitAcquisitionWrapper to the index_object() method
of an index. callable(wrapper) return 1 but calling
wrapper() fails with an AttributeError: __call__


==============================================================