select.epoll question

Paul Rubin no.email at nospam.invalid
Thu Feb 7 11:15:21 EST 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