Skip to content

Commit

Permalink
Add --inline-caches flag to dis command line (python#110249)
Browse files Browse the repository at this point in the history
  • Loading branch information
gvanrossum authored Oct 3, 2023
1 parent 21a6263 commit 6678ef4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Lib/dis.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,12 +901,14 @@ def _test():
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('-C', '--show-caches', action='store_true',
help='show inline caches')
parser.add_argument('infile', type=argparse.FileType('rb'), nargs='?', default='-')
args = parser.parse_args()
with args.infile as infile:
source = infile.read()
code = compile(source, args.infile.name, "exec")
dis(code)
dis(code, show_caches=args.show_caches)

if __name__ == "__main__":
_test()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add ``--inline-caches`` flag to ``dis`` command line.

0 comments on commit 6678ef4

Please sign in to comment.