[Zope] Architectural decisions

Paul Winkler pw_lists at slinkp.com
Mon May 24 18:49:19 EDT 2004

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

More information about the Zope mailing list