[Python-Dev] epoll() and kqueue wrapper for the select module

Ross Cohen rcohen at snurgle.org
Fri Dec 21 22:16:45 CET 2007


On Fri, Dec 21, 2007 at 11:28:55AM +0100, Christian Heimes wrote:
> Your wrapper is a good implementation. I even found an inconvenience in
> my implementation when I studied your code. My wrapper raised an
> exception when a closed fd was removed with EPOLL_CTL_DEL.

It should be a good reference, it's gotten a lot of testing.

> > I would also claim that adding a new interface to accomplish the same
> > task is not more pythonic. But I did write the python-epoll module in
> > question, so I may be a bit biased.
> 
> I agree with Gregory on that part of your answer.

I think we can both be right. The select.poll() code does not really
map to the low level poll() call. In fact, it maps much better to the
epoll() call. It appears that your new API is really a superset of the
the select.poll() interface. The only thing which keeps a user from
just importing your module and using it with code which uses the
existing interface is that you've changed names. Why not change the
names so that it Just Works?

Also, everything but the edge-triggered functionality could be
incorporated back into the select.poll() interface (where "everything"
means the modify() call.)

Ross
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.python.org/pipermail/python-dev/attachments/20071221/34af4cec/attachment.pgp 


More information about the Python-Dev mailing list