Skip to content
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

bpo-32970: Improve disassembly of the MAKE_FUNCTION instruction. #5937

Merged
merged 1 commit into from
Mar 11, 2018

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Feb 28, 2018

Copy link
Contributor

@ncoghlan ncoghlan left a comment

Choose a reason for hiding this comment

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

The MAKE_FUNCTION change looks good to me, but the FORMAT_VALUE changes seem unrelated.

argval = ((None, str, repr, ascii)[arg & 0x3], bool(arg & 0x4))
argrepr = ('', 'str', 'repr', 'ascii')[arg & 0x3]
argval, argrepr = FORMAT_VALUE_CONVERTERS[arg & 0x3]
argval = (argval, bool(arg & 0x4))
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like an unrelated refactoring?

Copy link
Member Author

Choose a reason for hiding this comment

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

Initially I implemented the logic for MAKE_FUNCTION as a sequence of ifs. But later I seen that it can be implemented using a single constant. Since I added the MAKE_FUNCTION_FLAGS global I take the chance to move constants for FORMAT_VALUE.

@serhiy-storchaka serhiy-storchaka merged commit e2732d3 into python:master Mar 11, 2018
@serhiy-storchaka serhiy-storchaka deleted the dis-MAKE_FUNCTION branch March 11, 2018 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants