[Boost-bugs] [Boost C++ Libraries] #3488: A better way to make python functions that take arbitrary number of args than raw_function

Subject: [Boost-bugs] [Boost C++ Libraries] #3488: A better way to make python functions that take arbitrary number of args than raw_function
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-09-25 20:48:32


#3488: A better way to make python functions that take arbitrary number of args
than raw_function
------------------------------+---------------------------------------------
 Reporter: loonycyborg | Owner: dave
     Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: Python
  Version: Boost 1.40.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------------------------------
 raw_function can handle only C++ functions that take two args (tuple,
 dict) and seems to cause static assert if a keyword-expression is passed
 to def thus causing a lot of manual code if one wants to make it take
 named arguments or default arguments.

 It would be nice if there was a way to make such functions closer to defs
 in python itself, something like this:


 {{{
 void foo(int arg1, int arg2, tuple args, dict kw);

 def("foo", foo, (arg("arg1") = 1, arg("arg2") = 2, arg("*args"),
 arg("**kw")) // that would pass extra positional args in foo's third arg
 and extra keyword args to foo's fourth arg
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3488>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:01 UTC