MCPcopy Index your code
hub / github.com/python/cpython / read_uint1

Function read_uint1

Lib/pickletools.py:212–222  ·  view source on GitHub ↗

r""" >>> import io >>> read_uint1(io.BytesIO(b'\xff')) 255

(f)

Source from the content-addressed store, hash-verified

210from struct import unpack as _unpack
211
212def read_uint1(f):
213 r"""
214 >>> import io
215 >>> read_uint1(io.BytesIO(b'\xff'))
216 255
217 """
218
219 data = f.read(1)
220 if data:
221 return data[0]
222 raise ValueError("not enough data in stream to read uint1")
223
224uint1 = ArgumentDescriptor(
225 name='uint1',

Callers 4

read_string1Function · 0.85
read_bytes1Function · 0.85
read_unicodestring1Function · 0.85
read_long1Function · 0.85

Calls 1

readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…