class documentation

class _RangeWrapper:

View In Hierarchy

This class can be used to convert an iterable object into an iterable that will only yield a piece of the underlying content. It yields blocks until the underlying stream range is fully read. The yielded blocks will have a size that can't exceed the original iterator defined block size, but that can be smaller.

If you're using this object together with a Response you have to use the direct_passthrough mode.

Parameters
iterablean iterable object with a __next__ method.
start​_bytebyte from which read will start.
byte​_rangehow many bytes to read.
Method __init__ Undocumented
Method __iter__ Undocumented
Method __next__ Undocumented
Method close Undocumented
Instance Variable byte​_range Undocumented
Instance Variable end​_byte Undocumented
Instance Variable end​_reached Undocumented
Instance Variable iterable Undocumented
Instance Variable read​_length Undocumented
Instance Variable seekable Undocumented
Instance Variable start​_byte Undocumented
Method ​_first​_iteration Undocumented
Method ​_next Undocumented
Method ​_next​_chunk Undocumented
def __init__(self, iterable, start_byte=0, byte_range=None):

Undocumented

Parameters
iterable:t.Union[t.Iterable[bytes], t.IO[bytes]]Undocumented
start​_byte:intUndocumented
byte​_range:t.Optional[int]Undocumented
def __iter__(self):

Undocumented

Returns
_RangeWrapperUndocumented
def __next__(self):

Undocumented

Returns
bytesUndocumented
def close(self):

Undocumented

byte_range =

Undocumented

end_byte =

Undocumented

end_reached: bool =

Undocumented

iterable =

Undocumented

read_length =

Undocumented

seekable =

Undocumented

start_byte =

Undocumented

def _first_iteration(self):

Undocumented

Returns
t.Tuple[t.Optional[bytes], int]Undocumented
def _next(self):

Undocumented

Returns
bytesUndocumented
def _next_chunk(self):

Undocumented

Returns
bytesUndocumented