Message 234460 - Python tracker (original) (raw)

Good catch.

CALL_FUNCTION seems to split its opcode into two to give it a positional-keyword pair so this seems fine. I'd hope we can do the same thing; personally I would do:

BUILD_MAP_UNPACK(
    position_of_function_in_stack_or_0 << 8 |
    number_to_pack
)

This way if building for a function we can do the check and give good errors that match the ones raised from CALL_FUNCTION. When the top 8 bits are 0, we don't do checks. What do you think? Would dual-usage be too confusing?