automatic conversion and overload proble
When overload is used, if functions whose parameters
use automatic conversions are declared first, the
functinos whose parameters are wrapped extension
classes do not resolve.
I attached a file which demonstrates what happens. Two
automatic conversions are defined, on GeVector2 and
GeVector3. Then 3 overloaded functions are defined and
exposed, the first two using the automatic conversions
from above, and the third using a simple Foo class.
When the functions using the automatic conversions are
declared after the function taking Foo as a parameter,
it all works.
Here is your test program:
import prob
f = prob.Foo()
print prob.testfoo( f )
However, the automatic conversions work between
themselves (i.e. a failed conversion to a GeVector2
when trying to convert a GeVector3 will not fail the
conversion to GeVector3).
I also found that by throwing the exception
unconditinoally at the beginning of the conversion
functions makes it work for the wrapped ext.class.
This indicates that the following code is the culprit:
// Convert from a list of two.
boost::python::list l =
from_python( p,
boost::python::type<boost::python::list>() );
runnign that makes the subsequent intent to convert to
a wrapped class fail somehow.
Any idea?
Change History
(6)
Status: |
assigned → closed
|