diff options
author | Bénédikt Tran <10796600+picnixz@users.noreply.github.com> | 2024-12-05 15:01:59 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-05 15:01:59 (GMT) |
commit | 67b9a5331ae45aa126877d7f96a1e235600f9c4b (patch) | |
tree | 8311be1530fa2a81fab9e415c2849b40e493d653 /Lib | |
parent | fcbe6ecdb6ed4dd93b2ee144f89a73af755e2634 (diff) | |
download | cpython-67b9a5331ae45aa126877d7f96a1e235600f9c4b.zip cpython-67b9a5331ae45aa126877d7f96a1e235600f9c4b.tar.gz cpython-67b9a5331ae45aa126877d7f96a1e235600f9c4b.tar.bz2 |
gh-127413: allow to show specialized bytecode via `dis` CLI (#127414)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/dis.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1125,6 +1125,8 @@ def main(): help='show instruction offsets') parser.add_argument('-P', '--show-positions', action='store_true', help='show instruction positions') + parser.add_argument('-S', '--specialized', action='store_true', + help='show specialized bytecode') parser.add_argument('infile', nargs='?', default='-') args = parser.parse_args() if args.infile == '-': @@ -1135,7 +1137,8 @@ def main(): with open(args.infile, 'rb') as infile: source = infile.read() code = compile(source, name, "exec") - dis(code, show_caches=args.show_caches, show_offsets=args.show_offsets, show_positions=args.show_positions) + dis(code, show_caches=args.show_caches, adaptive=args.specialized, + show_offsets=args.show_offsets, show_positions=args.show_positions) if __name__ == "__main__": main() |