<div dir="ltr">How do I disassemble a generated comprehension?<div><br></div><div>For example, I am trying to debug the following:</div><div><br></div><div><div>>>> dis.dis('{**{} for x in [{1:2}]}')</div><div>  1           0 LOAD_CONST               0 (<code object <dictcomp> at 0x10160b7c0, file "<dis>", line 1>)</div><div>              3 LOAD_CONST               1 ('<dictcomp>')</div><div>              6 MAKE_FUNCTION            0</div><div>              9 LOAD_CONST               2 (2)</div><div>             12 LOAD_CONST               3 (1)</div><div>             15 BUILD_MAP                1</div><div>             18 BUILD_LIST               1</div><div>             21 GET_ITER</div><div>             22 CALL_FUNCTION            1 (1 positional, 0 keyword pair)</div><div>             25 RETURN_VALUE</div></div><div><br></div><div>(This requires the new patch in issue 2292.)</div><div><br></div><div>The code here looks fine to me, so I need to look into the code object <dictcomp>.  How do I do that?</div><div><br></div><div>Thanks,</div><div><br></div><div>Neil</div></div>