On Tue, Sep 04, 2012 at 11:04:52PM -0700, Reid Price wrote: > Seems reasonable. Some notes inline, mostly nits and questions.
Thank you for review. > +class _SelectSelect(object): > + """ select.poll emulation by using select.select. > + Only register and poll are needed at the moment. > + """ > + def __init__(self): > > > > > + super(_SelectSelect, self).__init__() > > This makes me think you are trying to something clever, when (I believe) > you are not. Was there any particular reason to include it? Looking at python/ovs, I found that it's the style not to call super class __init__(). Ok, I'll follow the style. > + self.rlist = [] > + self.wlist = [] > + self.xlist = [] > + > + def register(self, fd, events): > + if isinstance(fd, socket.socket): > + fd = fd.fileno() > + assert isinstance(fd, int) > + if events & select.POLLIN: > + self.rlist.append(fd) > > > > > + events &= ~select.POLLIN > > I assume this is more typical to write it as this general form than as > events -= select.POLLIN > which is equivalent since you're already in the conditional I think '&= ~' is a widely used idiom to drop a given bit. -- yamahata _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev