Visualizer icon indicating copy to clipboard operation
Visualizer copied to clipboard

bytecode部分的含义

Open jiangke-sr opened this issue 2 years ago • 0 comments

        c = Bytecode.from_code(func.__code__)
        extra_code = [
                         Instr('STORE_FAST', '_res'),
                         Instr('LOAD_FAST', self.varname),
                         Instr('STORE_FAST', '_value'),
                         Instr('LOAD_FAST', '_res'),
                         Instr('LOAD_FAST', '_value'),
                         Instr('BUILD_TUPLE', 2),
                         Instr('STORE_FAST', '_result_tuple'),
                         Instr('LOAD_FAST', '_result_tuple'),
                     ]
        c[-1:-1] = extra_code

请教各位大佬,这部分的字节码是啥意思?是怎么得到@get_local值的?

jiangke-sr avatar Aug 04 '23 15:08 jiangke-sr