Re: [C++-sig] How to handle argument error exceptions in boost.python?

2014-01-14 Thread Giuseppe Corbelli
On 14/01/2014 12:45, Gary Oberbrunner wrote: ... What is the exception you see from the python side? something like: ArgumentError: Python argument types in function_name(function_args) did not match C++ signature: cpp_function_name(cpp_args) That's exactly what I'm trying to figu

Re: [C++-sig] How to handle argument error exceptions in boost.python?

2014-01-14 Thread Gary Oberbrunner
- Original Message - > From: "Jim Bosch" ... > My memory on this is a bit fuzzy, but I think it does get translated > to a custom Boost.Python exception (it's either that or a built-in > Python exception, which would make your task much more difficult, if > not impossible). Unfortunatel

Re: [C++-sig] BoostPython: C++ function with "non-const double reference" argument issue. Python looks for float causing argument mismatch.

2014-01-14 Thread Jim Bosch
The problem here isn't a mismatch between double and float, it's that Python's float object is immutable, and hence there's no way to translate it into a C++ lvalue. You simply can't wrap a C++ function with a "double &" (or "int &" or "string &") argument to Python with the same signature, regard

Re: [C++-sig] How to handle argument error exceptions in boost.python?

2014-01-14 Thread Jim Bosch
On Tue, Jan 14, 2014 at 6:45 AM, Gary Oberbrunner wrote: > > > - Original Message - >> From: "Giuseppe Corbelli" > ... >> What is the exception you see from the python side? something like: >> >> ArgumentError: Python argument types in >> function_name(function_args) >> did not match

[C++-sig] BoostPython: C++ function with "non-const double reference" argument issue. Python looks for float causing argument mismatch.

2014-01-14 Thread Liam Herron
Here is my example: --- CPP Code: --- #include using namespace boost::python; void updateDoubleReference(double& x) {

Re: [C++-sig] How to handle argument error exceptions in boost.python?

2014-01-14 Thread Gary Oberbrunner
- Original Message - > From: "Giuseppe Corbelli" ... > What is the exception you see from the python side? something like: > > ArgumentError: Python argument types in > function_name(function_args) > did not match C++ signature: > cpp_function_name(cpp_args) That's exactly wh

Re: [C++-sig] How to handle argument error exceptions in boost.python?

2014-01-14 Thread Giuseppe Corbelli
On 10/01/2014 14:16, Gary Oberbrunner wrote: [I posted this on StackOverflow yesterday, but got nothing. Hoping you will have some insight!] I'm writing a C++ python extension. I have a boost::python extension function static void EXTrender_effect(EffectGlobals_t *effect_handle,