Add --inline-caches flag to dis command line (#110249)

This commit is contained in:
Guido van Rossum 2023-10-02 17:49:34 -07:00 committed by GitHub
parent 21a6263020
commit 6678ef41d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View 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()

View file

@ -0,0 +1 @@
Add ``--inline-caches`` flag to ``dis`` command line.