3 ms·
I was curious how this works - it's using the Python standard library disassembler: https://docs.python.org/3/library/dis.html https://docs.python.org/3/library
by simonw 2y ago
I was curious how this works - it's using the Python standard library disassembler: https://docs.python.org/3/library/dis.html https://docs.python.org/3/library/dis.html
for instruction in dis.get_instructions(code):
...
Code here: https://github.com/tillahoffmann/localscope/blob/092392d5bdb02dd0413b87cee5d52628bf7e377e/localscope/__init__.py#L226-L254 https://github.com/tillahoffmann/localscope/blob/092392d5bdb...