Re: trellis question

nicky van foreest <[email protected]> Sun, 17 Jul 2011 21:48:22 +0200
Newsgroups gmane.comp.python.peak
Message-ID <CAK_GA2H8pH5N4k83pVR_OwVzzez=En+izZEXGvsEugThCKYp9w@mail.gmail.com>
Thanks. I'll try to understand this idea from the code.

On 17 July 2011 03:17, P.J. Eby <pje-Wh6+Hckhi6HFNGf7iClzIwC/[email protected]> wrote:
> At 11:33 PM 7/16/2011 +0200, nicky van foreest wrote:
>>
>> I wonder how trellis finds out that Sum.tot needs h.a for all the h's
>> in the list. How does it know, for instance, that h.a in the list
>> comprension sum( h.a for h in self.h) corresponds to a Cell? (Is
>> actually h.a stored/corresponds to a Cell?)
>
> Yes.  A trellis.attr declaration means the attribute is stored in a Cell
> instance, and reading the attribute reads the Cell, causing the dependency
> to be noticed while the 'tot' rule is being executed.  When the 'tot' rule
> is finished, Trellis looks at the read history and sees the list of cells to
> be used as the new dependency list for the 'tot' Cell.
>