bpo-31938: Convert selectmodule.c to Argument Clinic by taleinat · Pull Request #4265 · python/cpython (original) (raw)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm summarizing in hope to move forward with this.
The default for sizehint
should ideally be FD_SETSIZE - 1
, but FD_SETSIZE
isn't exposed at the Python level. The current behavior sets sizehint
to FD_SETSIZE - 1
if not supplied, but that's a type of inconsistency that AC aims to remove.
-1
is an invalid value, therefore it should probably not be used as a default value since that would change the existing semantics too much.
The docs say that sizehint
is deprecated and ignored, in which case this discussion would be moot. However in the code sizehint
is still passed to epoll_create()
if epoll_create1()
is not available:
#ifdef HAVE_EPOLL_CREATE1 self->epfd = epoll_create1(EPOLL_CLOEXEC); #else self->epfd = epoll_create(sizehint); #endif