CircBuf
¶
digraph inheritance6ba4a62218 {
rankdir=UD;
ratio=compress;
size="8.0, 12.0";
"CircBuf" [color=dodgerblue1,fontcolor=black,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.5,shape=box,style=rounded,tooltip="A circular buffer of Python values."];
}
-
class
CircBuf
(leng)[source]¶ Bases:
object
A circular buffer of Python values.
Examples:
>>> cb = CircBuf(3) >>> cb.is_empty() 1 >>> cb.put('first') >>> cb.is_empty() 0 >>> cb.put('second') >>> cb.put('third') >>> cb.is_full() 1 >>> cb.put('fourth') >>> cb.get() 'second' >>> cb.get() 'third' >>> cb.get() 'fourth' >>> cb.is_empty() 1