Why does the "dis" module print?

Michael Hudson mwh at python.net
Mon Aug 12 18:03:14 CEST 2002


tweedgeezer at hotmail.com (Jeremy Fincher) writes:

> It seems that it would be a lot easier to pull information out of
> the output of the dis.dis function if, instead of printing its
> results, it returned a list of the disassembled bytecodes.  Printing
> bytecodes from a returned list is trivial; making a list from the
> printed bytecodes is much less so.  Why does dis print instead of
> returning a list of bytecodes?

Because noone ever expected dis.dis to be used programmatically?  What
do you want to do with it?

Cheers,
M.

-- 
  Of course, it obviously is beta hardware so such things are to be
  expected, but that doesn't mean that you can't point your fingers
  and generate a nelson style HAHA at a multi billion dollar
  corporation's expense.                   -- CmdrTaco on slashdot.org



More information about the Python-list mailing list