Showing content from http://mail.python.org/pipermail/python-dev/attachments/20150125/64d60caf/attachment.html below:
<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>
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4