-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
Allow to show specialized bytecode via dis
CLI
#127413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
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. |
Actually, |
An example: Non-specialized bytecodeecho 'x = None' | ./python -m dis
0 RESUME 0
1 LOAD_CONST 0 (None)
STORE_NAME 0 (x)
LOAD_CONST 0 (None)
RETURN_VALUE Specialized bytecodeecho 'x = None' | ./python -m dis -S
0 RESUME 0
1 LOAD_CONST_IMMORTAL 0 (None)
STORE_NAME 0 (x)
LOAD_CONST_IMMORTAL 0 (None)
RETURN_VALUE |
Feature or enhancement
Proposal:
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
Links to previous discussion of this feature:
No response
Linked PRs
dis
CLI #127414The text was updated successfully, but these errors were encountered: