[Zope-dev] bizarre __call__ problem

Dieter Maurer dieter@handshake.de
Wed, 18 Jul 2001 21:11:52 +0200 (CEST)


seb bacon writes:
 > A strange one.  In my product, which is a folderish content type, I
 > have two functions with identical function bodies and signatures; the
 > only difference is the function name.  I try calling them like this
 > from dtml: 
 > 
 >  <dtml-with "getPageByDepth()"> / <dtml-with "boogaLoo()">
 > 
 > >From the first I get an AttributeError, from the other I do not:
 > 
 >  < snip >
 >   File /usr/local/Zope/lib/python/DocumentTemplate/DT_Util.py, line 334, in eval
 >                   (Object: getPageByDepth())
 >                   (Info: getPageByDepth)
 >                 File <string>, line 0, in ?
 >               AttributeError: __call__
Seems that "getPageByDepth" is an instance and not a function.

Maybe the name lookup finds a different object than you expect
and this object is not your function.


Dieter