summaryrefslogtreecommitdiffstats
path: root/Modules/selectmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-06-28 16:54:49 (GMT)
committerGuido van Rossum <guido@python.org>1998-06-28 16:54:49 (GMT)
commit1d8fb2d89478b461dcddaac16880886b14fd1977 (patch)
tree1b9427477fb68ecc9013618a64a27eec6d8133ae /Modules/selectmodule.c
parenta5e1b008a97f7c3c0ecf94543f1c3306d6c0e7e8 (diff)
downloadcpython-1d8fb2d89478b461dcddaac16880886b14fd1977.zip
cpython-1d8fb2d89478b461dcddaac16880886b14fd1977.tar.gz
cpython-1d8fb2d89478b461dcddaac16880886b14fd1977.tar.bz2
Added doc strings.
Diffstat (limited to 'Modules/selectmodule.c')
-rw-r--r--Modules/selectmodule.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index be0c604..dc3b521 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -314,18 +314,46 @@ select_select(self, args)
return ret;
}
+static char select_doc[] =
+"select(rlist, wlist, xlist[, timeout]) -> (rlist, wlist, xlist)\n\
+\n\
+Wait until one or more file descriptors are ready for some kind of I/O.\n\
+The first three arguments are lists of file descriptors to be waited for:\n\
+rlist -- wait until ready for reading\n\
+wlist -- wait until ready for writing\n\
+xlist -- wait for an ``exceptional condition''\n\
+If only one kind of condition is required, pass [] for the other lists.\n\
+A file descriptor is either a socket or file object, or a small integer\n\
+gotten from a fileno() method call on one of those.\n\
+\n\
+The optional 4th argument specifies a timeout in seconds; it may be\n\
+a floating point number to specify fractions of seconds. If it is absent\n\
+or None, the call will never time out.\n\
+\n\
+The return value is a tuple of three lists corresponding to the first three\n\
+arguments; each contains the subset of the corresponding file descriptors\n\
+that are ready.\n\
+\n\
+*** IMPORTANT NOTICE ***\n\
+On Windows, only sockets are supported; on Unix, all file descriptors.";
+
static PyMethodDef select_methods[] = {
- {"select", select_select, 1},
+ {"select", select_select, 1, select_doc},
{0, 0}, /* sentinel */
};
+static char module_doc[] =
+"This module supports asynchronous I/O on multiple file descriptors.\n\
+\n\
+*** IMPORTANT NOTICE ***\n\
+On Windows, only sockets are supported; on Unix, all file descriptors.";
void
initselect()
{
PyObject *m, *d;
- m = Py_InitModule("select", select_methods);
+ m = Py_InitModule3("select", select_methods, module_doc);
d = PyModule_GetDict(m);
SelectError = PyErr_NewException("select.error", NULL, NULL);
PyDict_SetItemString(d, "error", SelectError);