You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow to show specialized bytecode via dis CLI #127413
It's already possible to show specialized bytecode using dis.dis(code, adaptive=True) but it's not possible to do it from the CLI. I think we can add a flag -S that does it (most of the other flags are exposed to the CLI).
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
The CLI will show bytecode for code that's never run, so it will never be specialized.
Actually, dis.dis(adaptive=True) does show specialized bytecode. Or maybe I'm not using the correct terminology? For instance, a simple x = None shows a LOAD_CONST and not a LOAD_CONST_IMMORTAL, which is what I found weird.
Activity
JelleZijlstra commentedon Nov 29, 2024
Doesn't bytecode only get specialized after it is run? The CLI will show bytecode for code that's never run, so it will never be specialized.
picnixz commentedon Nov 29, 2024
Actually,
dis.dis(adaptive=True)does show specialized bytecode. Or maybe I'm not using the correct terminology? For instance, a simplex = Noneshows a LOAD_CONST and not a LOAD_CONST_IMMORTAL, which is what I found weird.picnixz commentedon Nov 30, 2024
An example:
Non-specialized bytecode
Specialized bytecode
gh-127413: allow to show specialized bytecode via `dis` CLI (#127414)
pythongh-127413: allow to show specialized bytecode via `dis` CLI (py…