Skip to content

Commit 6678ef4

Browse files
authored
Add --inline-caches flag to dis command line (#110249)
1 parent 21a6263 commit 6678ef4

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Lib/dis.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,12 +901,14 @@ def _test():
901901
import argparse
902902

903903
parser = argparse.ArgumentParser()
904+
parser.add_argument('-C', '--show-caches', action='store_true',
905+
help='show inline caches')
904906
parser.add_argument('infile', type=argparse.FileType('rb'), nargs='?', default='-')
905907
args = parser.parse_args()
906908
with args.infile as infile:
907909
source = infile.read()
908910
code = compile(source, args.infile.name, "exec")
909-
dis(code)
911+
dis(code, show_caches=args.show_caches)
910912

911913
if __name__ == "__main__":
912914
_test()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add ``--inline-caches`` flag to ``dis`` command line.

0 commit comments

Comments
 (0)