Skip to content

Commit 6f86628

Browse files
committed
bpo-41857: Document timeout arguments in select module
The docstring for the poll() methods of the select.poll[1] and select.devpoll[2] classes did not describe the expected units of the timeout argument (milliseconds). Previously this information was only available from the online documentation. This is a potential source of confusion, because other poll() methods in the select module, such as select.epoll and select.kqueue objects, use units of seconds (and were documented). Include the units in the docstring description so that this information is at least available from interactive help. [1] https://docs.python.org/3/library/select.html#select.poll.poll [2] https://docs.python.org/3/library/select.html#select.devpoll.poll
1 parent 0ec34ca commit 6f86628

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

Modules/clinic/selectmodule.c.h

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/selectmodule.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,8 @@ select_poll_unregister_impl(pollObject *self, int fd)
564564
select.poll.poll
565565
566566
timeout as timeout_obj: object = None
567+
The maximum time to wait in milliseconds, or else None (or a negative
568+
value) to wait indefinitely.
567569
/
568570
569571
Polls the set of registered file descriptors.
@@ -574,7 +576,7 @@ report, as a list of (fd, event) 2-tuples.
574576

575577
static PyObject *
576578
select_poll_poll_impl(pollObject *self, PyObject *timeout_obj)
577-
/*[clinic end generated code: output=876e837d193ed7e4 input=7a446ed45189e894]*/
579+
/*[clinic end generated code: output=876e837d193ed7e4 input=c2f6953ec45e5622]*/
578580
{
579581
PyObject *result_list = NULL;
580582
int poll_result, i, j;
@@ -895,6 +897,8 @@ select_devpoll_unregister_impl(devpollObject *self, int fd)
895897
/*[clinic input]
896898
select.devpoll.poll
897899
timeout as timeout_obj: object = None
900+
The maximum time to wait in milliseconds, or else None (or a negative
901+
value) to wait indefinitely.
898902
/
899903
900904
Polls the set of registered file descriptors.
@@ -905,7 +909,7 @@ report, as a list of (fd, event) 2-tuples.
905909

906910
static PyObject *
907911
select_devpoll_poll_impl(devpollObject *self, PyObject *timeout_obj)
908-
/*[clinic end generated code: output=2654e5457cca0b3c input=fd0db698d84f0333]*/
912+
/*[clinic end generated code: output=2654e5457cca0b3c input=3c3f0a355ec2bedb]*/
909913
{
910914
struct dvpoll dvp;
911915
PyObject *result_list = NULL;

0 commit comments

Comments
 (0)