Author jiwon
Recipients
Date 2006-08-31.01:06:34
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
This patch is implementation of pep 3102, keyword-only
parameter.

Important changes include

 * code object now has co_kwonlyargcount to keep the
number of keyword only argument - this is analogous to
co_argcount.
 * function object now has func_kwdefaults (dictionary)
to keep the mapping between keyword only arguments and
defaults for them. Only kwonly argument with default
values are in the dictionary - this is analogous to
func_defaults.
 * APIs for code object changed - both C API and Python
Api. PyCode_New now takes number of keyword only
arguments, and new.code also takes number of keyword
only arguments.
 * MAKE_FUNCTION now takes another oparg, which is
number of default keyword only arguments - and the name
of keyword only argument and its default value are in
the value stack - it is similar to oparg of CALL_FUNCTION.
 * MAGIC in import.c changed, since bytecode is changed.

That's pretty much everything that's important, and the
rest is in the code itself.

And my patch passes all regression tests excepts
test_frozen.py, which depends on the hard-coded mashal
value, which needs to be regenerated when bytecode
changes. However, freeze.py is broken - specifically,
modulefinder.py is broken as Guido said. So, currently,
I commented it out.
History
Date User Action Args
2007-08-23 15:54:26adminlinkissue1549670 messages
2007-08-23 15:54:26admincreate