Skip to content

gh-112720: Move dis's cache output code to the Formatter, labels lookup to the arg_resolver. Reduce the number of parameters passed around. #113108

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

Merged
merged 12 commits into from
Dec 15, 2023

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Dec 14, 2023

@iritkatriel iritkatriel changed the title gh-112720: Move dis's cache output code to the Formatter. Reduce the number of parameters passed around. gh-112720: Move dis's cache output code to the Formatter, labels lookup to the arg_resolver. Reduce the number of parameters passed around. Dec 14, 2023
@@ -113,7 +113,14 @@ def dis(x=None, *, file=None, depth=None, show_caches=False, adaptive=False,
elif hasattr(x, 'co_code'): # Code object
_disassemble_recursive(x, file=file, depth=depth, show_caches=show_caches, adaptive=adaptive, show_offsets=show_offsets)
elif isinstance(x, (bytes, bytearray)): # Raw bytecode
_disassemble_bytes(x, file=file, show_caches=show_caches, show_offsets=show_offsets)
Copy link
Member

@markshannon markshannon Dec 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need different handling now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not different handling, just different argument types. If we pass around the arg_resolver and formatter then we can plug in different implementations of them.

@iritkatriel iritkatriel merged commit 55ef998 into python:main Dec 15, 2023
corona10 pushed a commit to corona10/cpython that referenced this pull request Dec 15, 2023
…s lookup to the arg_resolver. Reduce the number of parameters passed around. (python#113108)
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
…s lookup to the arg_resolver. Reduce the number of parameters passed around. (python#113108)
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…s lookup to the arg_resolver. Reduce the number of parameters passed around. (python#113108)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants