[C++-sig] Py++: ArgumentError during calling a function of baseclas

Anand, Kumar kanand at qualcomm.com
Sat Jul 28 01:47:25 CEST 2007


Another data point which might be of some help:

Everything works fine if I create the evTest object in python and then
call the "getSynchronous" function on that object.

However, the error (listed in previous email) happens, whenever this
'evTest' object was actually created in C++ (and stored as a pointer
attribute "evTest*" inside another C++ object) and we try to access this
pointer attribute from Python and then try to invoke the
"getSynchronous" function.  Note that 'evTest' is being exposed with
held_type as auto_ptr. Just curious, will python actually return the
attribute in an auto_ptr and try to take ownership (even though Py++
exposes the attribute's accessor with return_internal_reference policy)?
Is the error somehow related to use of auto_ptr as held_type?

Thanks
Kumar

-----Original Message-----
From: c++-sig-bounces+kanand=qualcomm.com at python.org
[mailto:c++-sig-bounces+kanand=qualcomm.com at python.org] On Behalf Of
Roman Yakovenko
Sent: Friday, July 20, 2007 3:12 AM
To: Development of Python/C++ integration
Subject: Re: [C++-sig] Py++: ArgumentError during calling a function of
baseclas

On 7/20/07, Anand, Kumar <kanand at qualcomm.com> wrote:
> Hi,
>
> I have been getting errors like this: Any idea why this is happening
and how
> to debug it further? 'evTest' is a class that definitely derives from
> OMEvent and the relationship has been exposed to Python as well:
>
> ArgumentError: Python argument types in
>
>     OMEvent.getSynchronous(evTest)
>
> did not match C++ signature:
>
>     getSynchronous(OMEvent {lvalue})

It seems that you pass, for some reason one argument, when the
function doesn't take any argument. If evTest is instance of OMEvent,
than try next code:
evTest.getSynchronous()


-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
_______________________________________________
C++-sig mailing list
C++-sig at python.org
http://mail.python.org/mailman/listinfo/c++-sig



More information about the Cplusplus-sig mailing list