[Grok-dev] Using 'if object' evaluates false - container objects

Darryl Cousins darryl at darrylcousins.net.nz
Thu Apr 12 19:57:05 EDT 2007

Hi all,

This mail on zope3-users
http://mail.zope.org/pipermail/zope3-users/2007-April/006032.html turned
up just a few days after I found I needed to change a similar statement
in grok/component.py in Traverser class:

        if IReadContainer.providedBy(self.context):
            item = self.context.get(name)
            if item:
                return item

Should 'item' be an empty container it should read:

	    if item not None:
		return item



More information about the Grok-dev mailing list