Re: trellis attrs
nicky van foreest <[email protected]> Fri, 30 Sep 2011 22:16:41 +0200
| Newsgroups | gmane.comp.python.peak |
|---|---|
| Message-ID | <CAK_GA2F0-OkUrRy0ZY2Xn7HH9EKLFvN5VVot8_Uy_-U=Bsr6Og@mail.gmail.com> |
> They will actually work together. =A0If you do what I said, then you can =
also
> pass in a specific set as Lloyd suggests... =A0there's just no need to un=
less
> you want to use a specific set instead of having a empty default set
> created.
Ok. Thanks.
Sorry to bug you, but I tried also the following:
class Step(trellis.Component):
duration =3D trellis.attr(0)
def __init__(self, machine):
self.machine =3D machine
self.prevs =3D trellis.Set([])
instead of
class Step(trellis.Component):
prevs =3D trellis.make(trellis.Set)
duration =3D trellis.attr(0)
def __init__(self, machine):
self.machine =3D machine
This also works (that is, I get the same schedule in both cases). Is
there a difference between the two implementations? The second
implementation sets prevs as a class variable, but this does not
appear necessary (telling from implementation 1).
Nicky