Skip to content

Commit d3e890c

Browse files
committed
Docstrings and comments
1 parent 5d2f5cc commit d3e890c

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

Modules/_queuemodule.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ _queue_SimpleQueue___init___impl(simplequeueobject *self)
9797
return 0;
9898
}
9999

100+
/* XXX should we support dummy "block" and "timeout" args for compatibility? */
101+
100102
/*[clinic input]
101103
_queue.SimpleQueue.put
102104
item: object
@@ -161,7 +163,15 @@ _queue.SimpleQueue.get
161163
block: bool = True
162164
timeout: object = None
163165
164-
XXX
166+
Remove and return an item from the queue.
167+
168+
If optional args 'block' is true and 'timeout' is None (the default),
169+
block if necessary until an item is available. If 'timeout' is
170+
a non-negative number, it blocks at most 'timeout' seconds and raises
171+
the Empty exception if no item was available within that time.
172+
Otherwise ('block' is false), return an item if one is immediately
173+
available, else raise the Empty exception ('timeout' is ignored
174+
in that case).
165175
166176
[clinic start generated code]*/
167177

@@ -278,7 +288,7 @@ _queue_SimpleQueue_get_impl(simplequeueobject *self, int block,
278288
static PyMethodDef simplequeue_methods[] = {
279289
_QUEUE_SIMPLEQUEUE_GET_METHODDEF
280290
_QUEUE_SIMPLEQUEUE_PUT_METHODDEF
281-
/* XXX implement __sizeof__ */
291+
/* XXX implement __sizeof__, empty and qsize? */
282292
{NULL, NULL} /* sentinel */
283293
};
284294

@@ -330,9 +340,8 @@ PyTypeObject PySimpleQueueType = {
330340
/* Initialization function */
331341

332342
PyDoc_STRVAR(queue_module_doc,
333-
"XXX \n\
334-
This module provides primitive operations to write multi-threaded programs.\n\
335-
The 'threading' module provides a more convenient interface.");
343+
"C implementation of the Python queue module.\n\
344+
This module is an implementation detail, please do not use it directly.");
336345

337346
static struct PyModuleDef queuemodule = {
338347
PyModuleDef_HEAD_INIT,

Modules/_threadmodule.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
2-
/* Thread module */
3-
/* Interface to Sjoerd's portable C thread library */
4-
51
#include "Python.h"
62
#include "structmember.h" /* offsetof */
73

0 commit comments

Comments
 (0)