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

Class SimpleReader

Lib/test/test_pickletools.py:70–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68
69
70class SimpleReader:
71 def __init__(self, data):
72 self.data = data
73 self.pos = 0
74
75 def read(self, n):
76 data = self.data[self.pos: self.pos + n]
77 self.pos += n
78 return data
79
80 def readline(self):
81 nl = self.data.find(b'\n', self.pos) + 1
82 if not nl:
83 nl = len(self.data)
84 data = self.data[self.pos: nl]
85 self.pos = nl
86 return data
87
88
89class GenopsTests(unittest.TestCase):

Callers 3

test_without_posMethod · 0.70
test_mark_without_posMethod · 0.70

Calls

no outgoing calls

Tested by 3

test_without_posMethod · 0.56
test_mark_without_posMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…