| python Programming Glossary: disassembleWhy does Python code run faster in a function? http://stackoverflow.com/questions/11241523/why-does-python-code-run-faster-in-a-function  To examine bytecode use the dis module . I was able to disassemble the function directly but to disassemble the toplevel code I.. . I was able to disassemble the function directly but to disassemble the toplevel code I had to use the compile builtin .  share.. 
 How should I understand the output of dis.dis? http://stackoverflow.com/questions/12673074/how-should-i-understand-the-output-of-dis-dis  how should one interpret the output of dis.dis or dis.disassemble . Here is a very specific example in Python 2.7.3 dis.dis heapq.nsmallest.. 2.7   share improve this question   You are trying to disassemble a string containing source code but that's not supported by.. the string as if it contained byte code see the function disassemble_string in dis.py . So you are seeing nonsensical output based.. 
 Free Python decompiler that is not an online service? [closed] http://stackoverflow.com/questions/48211/free-python-decompiler-that-is-not-an-online-service  upload a pyc or pyo file to the dis module allows you to disassemble but not decompile bytecode decompile.py works only for 1.5.2.. 
 Does Python optimize function calls from loops? http://stackoverflow.com/questions/7243444/does-python-optimize-function-calls-from-loops  something together using a tool like byteplay or similar disassemble the inner function into bytecode and insert it into the outer.. 
 Developing a heuristic to test simple anonymous Python functions for equivalency http://stackoverflow.com/questions/9963155/developing-a-heuristic-to-test-simple-anonymous-python-functions-for-equivalency  classes methods functions or code. With no argument disassemble the last traceback. if isinstance x types.InstanceType x x.__class__..  print out Sorry msg  print out elif hasattr x 'co_code' disassemble x elif isinstance x str disassemble_string x else raise TypeError.. hasattr x 'co_code' disassemble x elif isinstance x str disassemble_string x else raise TypeError  don't know how to disassemble.. 
 |