On Mon, May 24, 2004 at 11:44:02PM +0100, Peter Bengtsson wrote:
Something I'm finding *slightly* annoying is the mix of Python semantics in Zope. In some places, one uses: object['attributeName'] ...and in others: getattr(object, 'attributeName') ...depending, of course, on the type of object with which one is provided. In one Python script I had, one container appeared to work the first way and another the second. ZPT seems to work it out every time. Is there a definitive listing of what things are treatable as dicts and which as objects?
If you're talking about ObjectManagers (Folders, Portal Folders and the like), it's good to be aware that if getattr(foofolder, 'bar') uses implicit acquisition; but foofolder['bar'] does not, it only looks in foofolder's sub-objects. -- Paul Winkler http://www.slinkp.com