[C++-sig] Re: Boost.Python not resolving overloads

Niall Douglas s_sourceforge at nedprod.com
Sun Sep 21 04:34:04 CEST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 20 Sep 2003 at 22:10, David Abrahams wrote:

> >> Wha???  No, it can't just guess at what you mean.  
> >
> > I don't see why. If one of my name()'s is zero parameters and the
> > other one takes a string
> 
> Neither is zero parameters, as the error indicates.  One takes an
> FXString and the other takes an FXFile.

As in, the non-static version takes "self", yes I get that ...

> Boost.Python uses the Python staticmethod wrapper to create static
> methods.

Which I used. And I should add there's no docs saying that you can't 
mix static and non-static names though I admit it's implied by how 
staticmethod() works.

> In this case, though, the behavior is known and expected.

Might it be an idea in the name of flexibility that boost.python 
marks mixed static and non-static functions and tries matching the 
static one first. If that fails, then it makes the first parameter 
"self" and tries again.

That way you get both working nicely in almost all cases, and a more 
accurate interface is provided to python?

Cheers,
Niall





-----BEGIN PGP SIGNATURE-----
Version: idw's PGP-Frontend 4.9.6.1 / 9-2003 + PGP 8.0.2

iQA/AwUBP20OHMEcvDLFGKbPEQLIeQCfZSFZ5ZQGXu6fl3VCzyPrgwx45HMAoJuX
lobGKR9LQrTiwdg6fCnvjAZQ
=QWz8
-----END PGP SIGNATURE-----




More information about the Cplusplus-sig mailing list