Chris McDonough wrote:
> > Sorry, just thought of another coupla questions:
> > If x is an instance of my class, then:
> > If I do x.a = 1, is _setOb called?
> > If I do print x.a, is _getOb called?
> No in either case.
> _setOb shouldn't be used directly in the current ObjectManger
> implementation. It doesn't populate the _objects list of the object manager
> on which it was called (your object won't show up). Instead, _setObject
> should be called.
well, thankfully, I'm not going near __setattr__, _setOb or _setObject :-)
On the setting side, only __setitem__ is getting meddled with, and I'm guessing
there's not gotachas there?
Anyway, using these methods:
# attribute - based traversal stuff
def _getOb(self, name, default=_marker):
...it would appear that unrestrictedTraverse first tries to use getattr and then
tries to use getitem to get a name. That much I can veryify from the code ;-)
However, it would appear that somewhere in a __getitem__ as implemented by
ZCatalog, _getOb ends up getting called. Which is a little confusing :-S
I think I know when the __get methods get called; same as normal python right?
But when, why, how and what by does _getOb and/org _getObject and/or anything
else I might be interested about in this space get called? ;-)
Thanks loads for the help so far,
Zope-Dev maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists -