[PEAK] Re: trellis.Set.discard

Sergey Schetinin maluke at gmail.com
Fri Oct 10 21:32:20 EDT 2008


It's not that different from .remove though..

Anyway here's a test:

class CV(Component):
    v = attr(False)
    s = make(Set)

    @maintain
    def maintain(self):
        if self.v:
            self.s.add(1)
        else:
            self.s.discard(1)

    @perform
    def perform(self):
        print self.v


@TaskCell
def task():
    cv = CV()
    cv.v = True
    yield Pause

EventLoop.run()

It silently undoes the task changes. I would have expected at least an
exception.



More information about the PEAK mailing list