Skip to content

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

Merged
serhiy-storchaka merged 1 commit into
python:masterfrom
serhiy-storchaka:dis-MAKE_FUNCTION
Mar 11, 2018
Merged

bpo-32970: Improve disassembly of the MAKE_FUNCTION instruction.#5937
serhiy-storchaka merged 1 commit into
python:masterfrom
serhiy-storchaka:dis-MAKE_FUNCTION

Conversation

@serhiy-storchaka

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

Copy link
Copy Markdown
Member

@ncoghlan ncoghlan left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread Lib/dis.py
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
Copy Markdown
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
Copy Markdown
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