[Zope3-dev] zope3-dev proposal on changing implicitly calling

Steve Alexander steve@z3u.com
Thu, 31 Jul 2003 15:20:42 +0300


>> What do you want to know about traversal in Zope 3?
> 
> How do you configure it?

You provide an adapter for ITraversable.
zope/app/interfaces/traversing.py


> What does it do by default?

There is a DefaultTraversable class in zope/app/traversing/adapters.py.

This is registered as the adapter for ITraversable for all objects that 
do not provide ITraversable directly or via __conform__ (see PEP 246) 
and do not have a more specific adapter registered for them.

The docstring of DefaultTraversable says:

   """Traverses objects via attribute and item lookup"""

The code is pretty simple.

There's a special case in the code, marked with an XXX that I inserted 
at about the time I made the proposal about making TALES not implicitly 
call objects that have a __call__ attribute. This special case detects 
if an attribute that has been traversed is a method. If it is a method, 
then the method is called with no arguments.

--
Steve Alexander