select.epoll question

Paul Rubin no.email at nospam.invalid
Thu Feb 7 17:15:21 CET 2013


Chris Angelico <rosuav at gmail.com> writes:
> fd_to_sock={sock.fileno():sock for sock in list_of_sockets}
> You'd need to manually maintain that as sockets get created/destroyed,
> though

Thanks, I was hoping to avoid that.  I'll have to check how
select.select manages to return sockets.  Maybe it builds such a dict
from the object list before it calls the system's select function, then
maps the result  back afterwards.  Ugh.



More information about the Python-list mailing list