class documentation

class _RangeWrapper: (source)

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 :class:`Response` you have to use the `direct_passthrough` mode. :param iterable: an iterable object with a :meth:`__next__` method. :param start_byte: byte from which read will start. :param byte_range: how 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: t.Union[t.Iterable[bytes], t.IO[bytes]], start_byte: int = 0, byte_range: t.Optional[int] = None): (source)

Undocumented

def __iter__(self) -> _RangeWrapper: (source)

Undocumented

def __next__(self) -> bytes: (source)

Undocumented

def close(self): (source)

Undocumented

byte_range = (source)

Undocumented

end_byte = (source)

Undocumented

end_reached: bool = (source)

Undocumented

iterable = (source)

Undocumented

read_length = (source)

Undocumented

seekable = (source)

Undocumented

start_byte = (source)

Undocumented

def _first_iteration(self) -> t.Tuple[t.Optional[bytes], int]: (source)

Undocumented

def _next(self) -> bytes: (source)

Undocumented

def _next_chunk(self) -> bytes: (source)

Undocumented