Package qm :: Package test :: Package classes :: Module sql_result_stream :: Class _Buffer
[hide private]
[frames] | no frames]

Class _Buffer

source code

A little buffering iterator with one-element rewind.

Instance Methods [hide private]
 
__init__(self, size, get_more)
Create a '_Buffer'.
source code
 
next(self)
Returns the next item, refilling the buffer if necessary.
source code
 
rewind(self) source code
 
__iter__(self) source code
Method Details [hide private]

__init__(self, size, get_more)
(Constructor)

source code 
Create a '_Buffer'.

'size' -- the number of items to hold in the buffer at a time.

'get_more' -- a function taking a number as its sole argument;
              should return a list of that many new items (or as
              many items are left, whichever is less).