Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment:
On Mon, Apr 11, 2011 at 5:21 PM, Antoine Pitrou <rep...@bugs.python.org> wrote: .. Raymond>> If you disassemble a function, you typically want to see all the code Raymond>> [defined] in that function. +1 (with clarification in []) If the function calls a function defined elsewhere, I don't want to see the called function disassembly when I disassemble the caller. In this case it is very easy to disassemble interesting functions with separate dis() calls. In the case like the following, however: def f(): def g(x): return x**2 dis(f) 2 0 LOAD_CONST 1 (<code object g at 0x10055ce88, file "x.py", line 2>) 3 MAKE_FUNCTION 0 6 STORE_FAST 0 (g) ... when I see '<code object g at 0x10055ce88, ..>', I have to do something unwieldy such as 3 0 LOAD_FAST 0 (x) 3 LOAD_CONST 1 (2) 6 BINARY_POWER 7 RETURN_VALUE > > That depends on the function. If you do event-driven programming (say, > Twisted deferreds with addCallback()), you don't necessarily want to see > the disassembly of the callbacks that are passed to the various > framework functions. Also, if you do so recursively, it might become > *very* unwieldy. Can you provide some examples of this? Nested functions are typically short and even if they are long, the size disassembly would be proportional to the line count of the function being disassembled, which is expected. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11822> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com