[pypy-dev] call_function
Ben.Young at risk.sungard.com
Ben.Young at risk.sungard.com
Fri Dec 16 17:24:09 CET 2005
Armin Rigo <arigo at tunes.org> wrote on 16/12/2005 16:19:52:
> Hi Ben,
>
> On Fri, Dec 16, 2005 at 01:19:00PM +0000, Ben.Young at risk.sungard.com
wrote:
> > Whay doesn't CALL_FUNCTION just pop oparg items off the stack and call
the
> > space call_function? It doesn't seem like the functionality would be
any
> > different as the varargs cases are handled differently anyway?
>
> But CALL_FUNCTION also handles keyword arguments, which
> space.call_function() does not.
>
>
Sorry, I meant:
def CALL_FUNCTION(f, oparg):
if oparg & 0xff == oparg:
w_function = f.valuestack.pop()
#pseudo code
w_args = f.valuestack.pop(oparg)
w_result = f.space.call_function(w_function, *w_args)
f.valuestack.push(w_result)
else:
# general case
f.call_function(oparg)
Doesn't this do the same thing? f.space.call_function seems to be able to
handle any number of positional args.
Cheers,
Ben
> Armin
>
More information about the Pypy-dev
mailing list