[Python-Dev] Python Call Mechanism

Guido van Rossum guido@python.org
Wed, 01 Nov 2000 23:24:29 -0500


> How about dumping the CALL_FUNCTION* opcodes, and replacing them with
> two non-argumented opcodes, called for the sake of argument NCALL_FUNC
> and NCALL_FUNC_KW.
> 
> NCALL_FUNC would pop a function object and a tuple off the stack and
> apply the function to the tuple.
> 
> NCALL_FUNC_KW would do the same, then pop a dictionary and then do
> the moral equivalent of f(*args,**kw).

No, this is a bad idea.  Long, long ago, all calls requird building a
tuple for the arguments first.  This tuple creation turned out to be a
major bottleneck.  That's why the current call opcode exists.

--Guido van Rossum (home page: http://www.python.org/~guido/)