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

Class ArgumentDescriptor

Lib/pickletools.py:174–208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172TAKEN_FROM_ARGUMENT8U = -5 # num bytes is 8-byte unsigned little-endian int
173
174class ArgumentDescriptor(object):
175 __slots__ = (
176 # name of descriptor record, also a module global name; a string
177 'name',
178
179 # length of argument, in bytes; an int; UP_TO_NEWLINE and
180 # TAKEN_FROM_ARGUMENT{1,4,8} are negative values for variable-length
181 # cases
182 'n',
183
184 # a function taking a file-like object, reading this kind of argument
185 # from the object at the current position, advancing the current
186 # position by n bytes, and returning the value of the argument
187 'reader',
188
189 # human-readable docs for this arg descriptor; a string
190 'doc',
191 )
192
193 def __init__(self, name, n, reader, doc):
194 assert isinstance(name, str)
195 self.name = name
196
197 assert isinstance(n, int) and (n >= 0 or
198 n in (UP_TO_NEWLINE,
199 TAKEN_FROM_ARGUMENT1,
200 TAKEN_FROM_ARGUMENT4,
201 TAKEN_FROM_ARGUMENT4U,
202 TAKEN_FROM_ARGUMENT8U))
203 self.n = n
204
205 self.reader = reader
206
207 assert isinstance(doc, str)
208 self.doc = doc
209
210from struct import unpack as _unpack
211

Callers 1

pickletools.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…