Built-in functions and keyword arguments

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Mon Oct 29 11:51:24 EDT 2007


On Mon, 29 Oct 2007 08:34:58 -0700, Armando Serrano Lombillo wrote:

> On Oct 29, 3:10 pm, Duncan Booth <duncan.bo... at invalid.invalid> wrote:
>>
>> I don't know if the reason that most builtin functions don't accept
>> keywords is just historical (someone would have to go through a lot of
>> code and add keyword argument names) or if there really is any
>> measurable performance difference to not using the METH_KEYWORDS option.
>> Being able to write less C code may be the main factor.
> 
> Ok. I was suspecting something like this. Performance issues aside, I
> think it would be a good idea if built-in functions behaved exactly
> the same as normal functions.

As Steven D'Aprano showed they behave like normal functions.  Even pure
Python functions can have arguments without names:

def spam(*args):
    pass

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list