mirror of
https://github.com/python/cpython
synced 2024-07-23 11:16:11 +00:00
Add --inline-caches flag to dis command line (#110249)
This commit is contained in:
parent
21a6263020
commit
6678ef41d2
|
@ -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()
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Add ``--inline-caches`` flag to ``dis`` command line.
|
Loading…
Reference in a new issue