Skip to content

gh-120780: Show attribute name for LOAD_SPECIAL in dis output #120781

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 3 commits into from
Jun 20, 2024

Conversation

JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented Jun 20, 2024

Lib/dis.py Outdated
@@ -609,6 +610,8 @@ def get_argval_argrepr(self, op, arg, offset):
argrepr = obj.__name__
else:
argrepr = repr(obj)
elif deop == LOAD_SPECIAL:
argrepr = get_special_method_names()[arg]
Copy link
Member

Choose a reason for hiding this comment

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

This creates the list every time. With the intrinsic descs we cache it in opcode.py.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, fixed

@JelleZijlstra JelleZijlstra merged commit e8e151d into python:main Jun 20, 2024
38 checks passed
@JelleZijlstra JelleZijlstra deleted the loadspecial branch June 20, 2024 14:07
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants