why not define a EVENT_ERROR in selectors module?

gansteed gansteed at gmail.com
Sun Feb 28 21:26:56 EST 2016


as the title:

    I'm reading the source code of selectors, I got this:

# generic events, that must be mapped to implementation-specific ones
EVENT_READ = (1 << 0)
EVENT_WRITE = (1 << 1)

    maybe we can add definitions for EVENT_ERROR like this:

# Choose the best implementation, roughly:
#    epoll|kqueue|devpoll > poll > select.
# select() also can't accept a FD > FD_SETSIZE (usually around 1024)
if 'KqueueSelector' in globals():
    DefaultSelector = KqueueSelector
    EVENT_ERROR = EVENT_WRITE << 1
elif 'EpollSelector' in globals():
    ...
elif ...:
    ...



More information about the Python-list mailing list