Re: trellis.Set.discard

"Sergey Schetinin" <[email protected]>
Newsgroups gmane.comp.python.peak
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.