[PEAK] Using peak.model as an observer subject

Doug Quale quale1 at charter.net
Thu Sep 2 00:06:24 EDT 2004


"Phillip J. Eby" <pje at telecommunity.com> writes:

> 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.

OK, I hadn't considered the possibility that feature objects could be
shared by different objects.  How would that happen, and under what
circumstances would we want to do it?



More information about the PEAK mailing list