[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

Thomas Kluyver report at bugs.python.org
Sat Apr 6 21:14:46 CEST 2013


Thomas Kluyver added the comment:

I've added docs and tests, and split the changes to test_peepholer into a separate patch.

I haven't re-exposed details of the code object as attributes of Bytecode instances, because they're already available as e.g. bytecode.codeobj.co_names . I think it would be more confusing than useful to offer the same values in two places, though I'm open to discussion on this.

I've re-organised the dis module docs a bit. I've put Bytecode at the top, as I think it's a more intuitive API than the functions, which have somewhat counter-intuitive names due to the module's history.

----------
Added file: http://bugs.python.org/file29694/dis_api3.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11816>
_______________________________________


More information about the Python-bugs-list mailing list