[Zope-dev] Where is has() defined?

Michel Pelletier michel@zope.com
Wed, 05 Sep 2001 10:32:12 -0700


Evan Simpson wrote:
> 
> Kyler B. Laird wrote:
> 
> > I'm trying to read
> >       python/Products/PageTemplates/Expressions.py
> > and
> >       python/OFS/Traversable.py
> > but I am at a loss for the definition of has().
> 
> Just add "has=hasattr" right after "get=getattr" (line 145 of
> Traversable.py).

I think he wanted to know where it was defined, not where he can define
it.

Kyler, take a look at the definition for the restrictedTraverse method
in Expressions.py:

def restrictedTraverse(self, path, securityManager,
                       get=getattr, has=hasattr, N=None, M=[]):

That's where it's defined.

-Michel