diff options
author | Guido van Rossum <guido@python.org> | 2023-10-03 00:49:34 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-03 00:49:34 (GMT) |
commit | 6678ef41d2a188a92c7ac5249d716e942b5114a6 (patch) | |
tree | d4e8bd4df38b2ab8400ca68988e83469ba9f7c84 | |
parent | 21a6263020db17020b2886f996bc23aa8cb7fbdf (diff) | |
download | cpython-6678ef41d2a188a92c7ac5249d716e942b5114a6.zip cpython-6678ef41d2a188a92c7ac5249d716e942b5114a6.tar.gz cpython-6678ef41d2a188a92c7ac5249d716e942b5114a6.tar.bz2 |
Add --inline-caches flag to dis command line (#110249)
-rw-r--r-- | Lib/dis.py | 4 | ||||
-rw-r--r-- | Misc/NEWS.d/next/Library/2023-10-03-00-04-26.gh-issue-110249.K0mMrs.rst | 1 |
2 files changed, 4 insertions, 1 deletions
@@ -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 index 0000000..a7c9c0f --- /dev/null +++ b/Misc/NEWS.d/next/Library/2023-10-03-00-04-26.gh-issue-110249.K0mMrs.rst @@ -0,0 +1 @@ +Add ``--inline-caches`` flag to ``dis`` command line. |