MCPcopy Index your code
hub / github.com/RustPython/RustPython / read_uint8

Function read_uint8

Lib/pickletools.py:294–306  ·  view source on GitHub ↗

r""" >>> import io >>> read_uint8(io.BytesIO(b'\xff\x00\x00\x00\x00\x00\x00\x00')) 255 >>> read_uint8(io.BytesIO(b'\xff' * 8)) == 2**64-1 True

(f)

Source from the content-addressed store, hash-verified

292
293
294def read_uint8(f):
295 r"""
296 >>> import io
297 >>> read_uint8(io.BytesIO(b'\xff\x00\x00\x00\x00\x00\x00\x00'))
298 255
299 >>> read_uint8(io.BytesIO(b'\xff' * 8)) == 2**64-1
300 True
301 """
302
303 data = f.read(8)
304 if len(data) == 8:
305 return _unpack("<Q", data)[0]
306 raise ValueError("not enough data in stream to read uint8")
307
308uint8 = ArgumentDescriptor(
309 name='uint8',

Callers 3

read_bytes8Function · 0.85
read_bytearray8Function · 0.85
read_unicodestring8Function · 0.85

Calls 2

lenFunction · 0.85
readMethod · 0.45

Tested by

no test coverage detected