]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add --inline-caches flag to dis command line (#110249)
authorGuido van Rossum <guido@python.org>
Tue, 3 Oct 2023 00:49:34 +0000 (17:49 -0700)
committerGitHub <noreply@github.com>
Tue, 3 Oct 2023 00:49:34 +0000 (00:49 +0000)
Lib/dis.py
Misc/NEWS.d/next/Library/2023-10-03-00-04-26.gh-issue-110249.K0mMrs.rst [new file with mode: 0644]

index 7e4792e8a8dc626d92c1e91e276d353ce19fd14a..633c01b6fce56aea3017240b14db2194e0482a56 100644 (file)
@@ -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()
diff --git a/Misc/NEWS.d/next/Library/2023-10-03-00-04-26.gh-issue-110249.K0mMrs.rst b/Misc/NEWS.d/next/Library/2023-10-03-00-04-26.gh-issue-110249.K0mMrs.rst
new file mode 100644 (file)
index 0000000..a7c9c0f
--- /dev/null
@@ -0,0 +1 @@
+Add ``--inline-caches`` flag to ``dis`` command line.