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

Neal Becker ndbecker2 at gmail.com
Wed Mar 8 18:52:23 CET 2006


Alex Mohr wrote:

>> not
>> 
>>    o(A1..N, unpacked_dict_args)
>> 
>> as well?
> 
> Yes -- that too, and that's what I've implemented.
> 
>> That won't work with the old broken compilers (vc6/7), I think, which
>> -- at least for now -- are still supported.  But I think it's pretty
>> easy to do something inside boost/python/call.hpp to make it recognize
>> the unpacked tuple and dict arguments and treat them specially.
> 
> Interesting.  The only environments I have readily available are gcc 4+
> on linux and vc-8_0 on Windows and the obvious thing seems to work on
> those.  So I'll likely need some help with supporting the older
> compilers.  Or -- is there an existing pattern somewhere that I can look
> at?
> 
>> If you just modify boost::python::call<> you don't need to touch
>> anything else.
> 
> That's true -- I'll do that.  There is the question of whether
> unpacked_tuple and unpacked_dict should count against MAX_ARITY though.
>   That is, is MAX_ARITY the max number of explicit positional args, or
> is MAX_ARITY the max number of c++ args?
> 
> What is the preferred way of generating a patch to post to the list?
> 

Diff? :)




More information about the Cplusplus-sig mailing list