Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ce67f06

Browse files
committed
Update documentation to reflect changes to Queue.py by Tim Peters.
1 parent 9e1721f commit ce67f06

1 file changed

Lines changed: 29 additions & 15 deletions

File tree

Doc/lib/libqueue.tex

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,15 @@ \section{\module{Queue} ---
2525
\end{classdesc}
2626

2727
\begin{excdesc}{Empty}
28-
Exception raised when non-blocking get (e.g. \method{get_nowait()}) is
29-
called on a \class{Queue} object which is empty, or for which the
30-
emptyiness cannot be determined (i.e. because the appropriate locks
31-
cannot be acquired).
28+
Exception raised when non-blocking \method{get()} (or
29+
\method{get_nowait()}) is called on a \class{Queue} object which is
30+
empty or locked.
31+
\end{excdesc}
32+
33+
\begin{excdesc}{Full}
34+
Exception raised when non-blocking \method{put()} (or
35+
\method{get_nowait()}) is called on a \class{Queue} object which is
36+
full or locked.
3237
\end{excdesc}
3338

3439
\subsection{Queue Objects}
@@ -41,31 +46,40 @@ \subsection{Queue Objects}
4146
methods are:
4247

4348
\begin{methoddesc}{qsize}{}
44-
Returns the approximate size of the queue. Because of multithreading
49+
Return the approximate size of the queue. Because of multithreading
4550
semantics, this number is not reliable.
4651
\end{methoddesc}
4752

4853
\begin{methoddesc}{empty}{}
49-
Returns \code{1} if the queue is empty, \code{0} otherwise. Because
54+
Return \code{1} if the queue is empty, \code{0} otherwise. Because
5055
of multithreading semantics, this is not reliable.
5156
\end{methoddesc}
5257

5358
\begin{methoddesc}{full}{}
54-
Returns \code{1} if the queue is full, \code{0} otherwise. Because of
59+
Return \code{1} if the queue is full, \code{0} otherwise. Because of
5560
multithreading semantics, this is not reliable.
5661
\end{methoddesc}
5762

58-
\begin{methoddesc}{put}{item}
59-
Puts \var{item} into the queue.
63+
\begin{methoddesc}{put}{item\optional{, block}}
64+
Put \var{item} into the queue. If optional argument \var{block} is 1
65+
(the default), block if necessary until a free slot is available.
66+
Otherwise (\var{block} is 0), put \var{item} on the queue if a free
67+
slot is immediately available, else raise the \exception{Full}
68+
exception.
69+
\end{methoddesc}
70+
71+
\begin{methoddesc}{put_nowait}{item}
72+
Equivalent to \code{put(\var{item}, 0)}.
6073
\end{methoddesc}
6174

62-
\begin{methoddesc}{get}{}
63-
Gets and returns an item from the queue, blocking if necessary until
64-
one is available.
75+
\begin{methoddesc}{get}{\optional{block}}
76+
Remove and return an item from the queue. If optional argument
77+
\var{block} is 1 (the default), block if necessary until an item is
78+
available. Otherwise (\var{block} is 0), return an item if one is
79+
immediately available, else raise the
80+
\exception{Empty} exception.
6581
\end{methoddesc}
6682

6783
\begin{methoddesc}{get_nowait}{}
68-
Gets and returns an item from the queue if one is immediately
69-
available. Raises an \exception{Empty} exception if the queue is
70-
empty or if the queue's emptiness cannot be determined.
84+
Equivalent to \code{get(0)}.
7185
\end{methoddesc}

0 commit comments

Comments
 (0)