[PEAK] Using peak.model as an observer subject
Phillip J. Eby
pje at telecommunity.com
Wed Sep 1 23:27:42 EDT 2004
At 09:48 PM 9/1/04 -0500, Doug Quale wrote:
>"Phillip J. Eby" <pje at telecommunity.com> writes:
>
> > At 09:11 PM 9/1/04 -0500, Doug Quale wrote:
> >
> > >I have a Python 101 type question: What is the advantage of using
> > >key = feature.attrName+'__event' instead of key = '__event'?
> >
> > To have an event object for each feature.
>
>But doesn't each feature already have a separate __dict__?
It does, but that's not the one we're using. If we did, callbacks would be
issued when that feature was changed on *any* object, not just the one we
registered on.
> I apologize if I'm just being dense.
It's not you, it's me... I just looked back at what I wrote and I had
'feature.__dict__' where I meant to use 'element.__dict__'. Good catch.
More information about the PEAK
mailing list