On Fri, Jul 2, 2010 at 12:25 PM, Steven D'Aprano <st...@pearwood.info> wrote:
> Craig, what are you using to get that? When I try it in Python 3.1, I
> get:
>
> TypeError: don't know how to disassemble str objects
>
> How do you get that result?

As I just discovered (see above), dis.dis is happy to interpret byte
strings (i.e., strings in 2.x, bytes in 3.x) as direct representations
of Python bytecode.

There's also an open feature request[1] to allow text strings as input
in py3k, doing an automatic compile before passing the result to
dis.dis.

Mark

[1] http://bugs.python.org/issue6507
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to