Skip to content

Commit 372ee27

Browse files
authored
bpo-38580: Document that select() accepts iterables, not just sequences (GH-16832)
1 parent cba5031 commit 372ee27

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Doc/library/select.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ The module defines the following:
117117
.. function:: select(rlist, wlist, xlist[, timeout])
118118

119119
This is a straightforward interface to the Unix :c:func:`select` system call.
120-
The first three arguments are sequences of 'waitable objects': either
120+
The first three arguments are iterables of 'waitable objects': either
121121
integers representing file descriptors or objects with a parameterless method
122122
named :meth:`~io.IOBase.fileno` returning such an integer:
123123

@@ -126,7 +126,7 @@ The module defines the following:
126126
* *xlist*: wait for an "exceptional condition" (see the manual page for what
127127
your system considers such a condition)
128128

129-
Empty sequences are allowed, but acceptance of three empty sequences is
129+
Empty iterables are allowed, but acceptance of three empty iterables is
130130
platform-dependent. (It is known to work on Unix but not on Windows.) The
131131
optional *timeout* argument specifies a time-out as a floating point number
132132
in seconds. When the *timeout* argument is omitted the function blocks until
@@ -141,7 +141,7 @@ The module defines the following:
141141
single: socket() (in module socket)
142142
single: popen() (in module os)
143143

144-
Among the acceptable object types in the sequences are Python :term:`file
144+
Among the acceptable object types in the iterables are Python :term:`file
145145
objects <file object>` (e.g. ``sys.stdin``, or objects returned by
146146
:func:`open` or :func:`os.popen`), socket objects returned by
147147
:func:`socket.socket`. You may also define a :dfn:`wrapper` class yourself,

Modules/clinic/selectmodule.c.h

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

Modules/selectmodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ select.select
239239
240240
Wait until one or more file descriptors are ready for some kind of I/O.
241241
242-
The first three arguments are sequences of file descriptors to be waited for:
242+
The first three arguments are iterables of file descriptors to be waited for:
243243
rlist -- wait until ready for reading
244244
wlist -- wait until ready for writing
245245
xlist -- wait for an "exceptional condition"
@@ -264,7 +264,7 @@ descriptors can be used.
264264
static PyObject *
265265
select_select_impl(PyObject *module, PyObject *rlist, PyObject *wlist,
266266
PyObject *xlist, PyObject *timeout_obj)
267-
/*[clinic end generated code: output=2b3cfa824f7ae4cf input=177e72184352df25]*/
267+
/*[clinic end generated code: output=2b3cfa824f7ae4cf input=e467f5d68033de00]*/
268268
{
269269
#ifdef SELECT_USES_HEAP
270270
pylist *rfd2obj, *wfd2obj, *efd2obj;
@@ -320,7 +320,7 @@ select_select_impl(PyObject *module, PyObject *rlist, PyObject *wlist,
320320
}
321321
#endif /* SELECT_USES_HEAP */
322322

323-
/* Convert sequences to fd_sets, and get maximum fd number
323+
/* Convert iterables to fd_sets, and get maximum fd number
324324
* propagates the Python exception set in seq2set()
325325
*/
326326
rfd2obj[0].sentinel = -1;

0 commit comments

Comments
 (0)