[Python-Dev] MAKE_FUNCTION simplification
Victor Stinner
victor.stinner at gmail.com
Thu Apr 14 11:32:14 EDT 2016
2016-04-14 11:04 GMT+02:00 Nikita Nemkin <nikita at nemkin.ru>:
> MAKE_FUNCTION opcode is complex due to the way it receives
> input arguments: (...)
Yeah, I was always disturbed how this opcode gets parameters.
> My suggestion is to pre-package 1-4 before calling MAKE_FUNCTION,
> i.e. explicitly emit BUILD_TUPLE for defaults args and BUILD_MAPs
> for keyword defaults and annotations.
I read the code. I fact, I don't understand why it wasn't done like
that since the beginning :-p
> Then, MAKE_FUNCTION will become a dramatically simpler
> 5 argument opcode, taking
Would you like to work on a patch to implement that change?
Since Python 3.6 may get a new bytecode format (wordcode, see the
other thread on this mlailing list), I think that it's ok to change
MAKE_FUNCTION in the same release.
Victor
More information about the Python-Dev
mailing list