[issue6507] Enhance dis.dis to autocompile codestrings

Terry J. Reedy report at bugs.python.org
Fri Jul 2 22:19:29 CEST 2010


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Just today, someone posted the result of dis.dis('somebytes') and did not notice the error because dis blithely disassembles bytes as bytecodes, even in 3.x. (The person actually dissed a 2.x string).

>>> from dis import dis
>>> dis(b'cat')
          0 DUP_TOPX        29793

It is a natural thing to do, so I hope this is put in 3.2. 

Since the undocumented 'disassemble_string' now disassembles bytes, I think it should be renamed '_disassemble_bytes' instead of '_disassemble_string'. This would accord with the general effort to remove 2.x fossils from 3.x.

Aside from that, it looks ready, from a reading review, to apply and test: doc addition, added tests, new function and else case, and rename.

----------

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


More information about the Python-bugs-list mailing list