GH-105678: Split MAKE_FUNCTION into MAKE_FUNCTION and SET_FUNCTION_ATTRIBUTE (GH-105680)

This commit is contained in:
Mark Shannon 2023-06-13 09:51:05 +01:00 committed by GitHub
parent 217589d4f3
commit 09ffa69e2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 480 additions and 430 deletions

View file

@ -32,8 +32,8 @@ FORMAT_VALUE_CONVERTERS = (
(repr, 'repr'),
(ascii, 'ascii'),
)
MAKE_FUNCTION = opmap['MAKE_FUNCTION']
MAKE_FUNCTION_FLAGS = ('defaults', 'kwdefaults', 'annotations', 'closure')
SET_FUNCTION_ATTRIBUTE = opmap['SET_FUNCTION_ATTRIBUTE']
FUNCTION_ATTR_FLAGS = ('defaults', 'kwdefaults', 'annotations', 'closure')
LOAD_CONST = opmap['LOAD_CONST']
RETURN_CONST = opmap['RETURN_CONST']
@ -586,8 +586,8 @@ def _get_instructions_bytes(code, varname_from_oparg=None,
if argrepr:
argrepr += ', '
argrepr += 'with format'
elif deop == MAKE_FUNCTION:
argrepr = ', '.join(s for i, s in enumerate(MAKE_FUNCTION_FLAGS)
elif deop == SET_FUNCTION_ATTRIBUTE:
argrepr = ', '.join(s for i, s in enumerate(FUNCTION_ATTR_FLAGS)
if arg & (1<<i))
elif deop == BINARY_OP:
_, argrepr = _nb_ops[arg]