[Zope3-dev] calling objects when evaluating path expressions

Guido van Rossum guido@python.org
Fri, 20 Jun 2003 07:34:05 -0400


> Conclusion 2: TALES should not try to call things at all. This should be 
> left up to the Zope traversal components, so that the behaviour may be 
> customised.

Now that we have properties, I see no reason to ever call things at
all.  The call-if-callable behavior is a carryover from Zope2 and
pre-new-style-classes Python, when it was really painful to provide a
computed attribute.

>    3: Making the zope 3 default traversal machinery call an object on
>       traversal if and only if the following conditions hold:
> 
>       a: the object provides no interfaces
> 
>       b: the object has a __call__ attribute
> 
>       c: on inspection, it appears that the __call__ attribute can be
>          called with no arguments
> 
>    This will most usefully apply to instance methods, static methods,
>    class methods and method-wrappers (which are how builtin methods
>    appear to Python).

I'd propose to skip even this.  Or is that too radical?

(I probably won't be able to participate further in this discussion on
email, as I'm preparing for my trip to Belgium later today.  However,
I'll see many of you at the sprints in LLN, or at least at
EuroPython.)

--Guido van Rossum (home page: http://www.python.org/~guido/)