Skip to content

Commit e3e800f

Browse files
taleinatjstasiak
andauthored
[3.8] bpo-38580: Document that select() accepts iterables, not just sequences (GH-16832)
(cherry picked from commit 372ee27) Co-authored-by: Jakub Stasiak <jakub@stasiak.at>
1 parent 5ff5edf commit e3e800f

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

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
@@ -218,7 +218,7 @@ select.select
218218
219219
Wait until one or more file descriptors are ready for some kind of I/O.
220220
221-
The first three arguments are sequences of file descriptors to be waited for:
221+
The first three arguments are iterables of file descriptors to be waited for:
222222
rlist -- wait until ready for reading
223223
wlist -- wait until ready for writing
224224
xlist -- wait for an "exceptional condition"
@@ -243,7 +243,7 @@ descriptors can be used.
243243
static PyObject *
244244
select_select_impl(PyObject *module, PyObject *rlist, PyObject *wlist,
245245
PyObject *xlist, PyObject *timeout_obj)
246-
/*[clinic end generated code: output=2b3cfa824f7ae4cf input=177e72184352df25]*/
246+
/*[clinic end generated code: output=2b3cfa824f7ae4cf input=e467f5d68033de00]*/
247247
{
248248
#ifdef SELECT_USES_HEAP
249249
pylist *rfd2obj, *wfd2obj, *efd2obj;
@@ -299,7 +299,7 @@ select_select_impl(PyObject *module, PyObject *rlist, PyObject *wlist,
299299
}
300300
#endif /* SELECT_USES_HEAP */
301301

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

0 commit comments

Comments
 (0)