[PEAK] trellis attrs
python at venix.com
Fri Sep 30 08:31:25 EDT 2011
On Fri, 2011-09-30 at 14:05 +0200, nicky van foreest wrote:
> class Batch(trellis.Component):
> prevs = trellis.Set(,
> duration = 0,
> The problem is that all batches use the same trellis.Set, but I want
> each batch to have its own trellis.Set.
The trellis.Set is getting assigned as a class variable. With immutable
types, this works as you'd expect, and the objects will get their own
object references when you assign new values. If prevs were an integer,
assigning to to b3.prevs would work as you want.
b3 = Batch( prevs=trellis.Set() )
I think that's the correct way to approach what you're trying to do. I
trust PJE will set things straight if I'm pushing you in the wrong
direction. My experience with Trellis is quite limited.
More information about the PEAK