[C++-sig] Re: calling python method using keywords

Stefan Seefeld seefeld at sympatico.ca
Tue Jan 13 05:59:44 CET 2004

David Abrahams wrote:

>>what's wrong with a version of 'call' like
>>object call(const tuple &t, const dict &d);
> It doesn't take a callable object?

oh, definitely, sorry. Make that

object call(object o, const tuple &t=tuple(), const dict &d=dict());

with default arguments as in python...

I suggested const refs for the arguments because I can see one
usage where they are passed as temporaries:

object a1 = ...;
object a2 = ...;

object callable;

object retn = call(callable, tuple(a1, a2))

Does this make sense ?

(with that a new overloaded 'operator()' could be
added to the object_operators interface with the
appropriate signature)


More information about the Cplusplus-sig mailing list