def _UnpackOpArgs(self, code):
"""Unpack the operations and arguments from the byte code. From Python
3.5 onwards this is found in the private method _unpack_opargs
but for earlier releases this wasn't available as a separate
method."""
opIndex = 0
numOps = len(code)
while opIndex < numOps:
offset = opIndex
op = code[opIndex]
opIndex += 1
arg = None
if op >= dis.HAVE_ARGUMENT:
arg = code[opIndex] + code[opIndex + 1] * 256
opIndex += 2
yield (offset, op, arg)
评论列表
文章目录