We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9fb7070 commit acc75deCopy full SHA for acc75de
Lib/dis.py
@@ -1 +1,18 @@
1
from _dis import *
2
+
3
4
+# Disassembling a file by following cpython Lib/dis.py
5
+def _test():
6
+ """Simple test program to disassemble a file."""
7
+ import argparse
8
9
+ parser = argparse.ArgumentParser()
10
+ parser.add_argument('infile', type=argparse.FileType('rb'), nargs='?', default='-')
11
+ args = parser.parse_args()
12
+ with args.infile as infile:
13
+ source = infile.read()
14
+ code = compile(source, args.infile.name, "exec")
15
+ dis(code)
16
17
+if __name__ == "__main__":
18
+ _test()
0 commit comments