[C++-sig] Calling python from c++ with tuple and dict args.

David Abrahams dave at boost-consulting.com
Tue Mar 7 20:59:01 CET 2006


"Nat Goodspeed" <ngoodspeed at solidworks.com> writes:

>> -----Original Message-----
>> From: c++-sig-bounces at python.org [mailto:c++-sig-bounces at python.org]
> On
>> Behalf Of David Abrahams
>> Sent: Tuesday, March 07, 2006 2:26 PM
>> To: c++-sig at python.org
>> Subject: Re: [C++-sig] Calling python from c++ with tuple and dict
> args.
>> 
>> > It seems like it would be possible to do something like this:
>> >
>> > bp::object::operator()(bp::unpacked_tuple const &args,
>> >                         bp::unpacked_dict const &kw) {
>> >      // call as self(*args, **kw)
>> > }
>> >
>> > And then define unary * operators for tuple and dict so that *tuple
>> > would produce an unpacked_tuple and **dict would produce an
>> unpacked_dict.
>
> [Nat] I find myself wondering what *dict should produce -- an error?

Clearly not.  You can't get to **dict without *dict.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




More information about the Cplusplus-sig mailing list