[C++-sig] Re: function::argument_error / overloads & docstrings

David Abrahams dave at boost-consulting.com
Thu Nov 6 02:03:09 CET 2003


Nikolay Mladenov <nickm at sitius.com> writes:

> with what I currently have (cvs patched by me) I get:
>
>
>>>> import keywords
>>>> keywords.Foo(.1)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> Boost.Python.ArgumentError: Python argument types in
>     Foo.__init__(Foo, float)
> did not match C++ signature:
>     __init__(struct _object *, int a=0, double b=0.0, class
> _STL::basic_string<char,struct std::char_traits<char>,class
> _STL::allocator<char> > n="")
>>>> help(keywords.Foo.set)
>
> Help on method set:
>
> set(...) unbound keywords.Foo method
>     set(struct Foo self, class _STL::basic_string<char,struct
> std::char_traits<char>,class _STL::allocator<char> > n)
>         Sets the string field of self
>     set(struct Foo self, double b)
>          Sets the float field of self
>     set(struct Foo self, int a)
>          Sets the integer field of self
>     set(struct Foo self, int a=0, double b=0.0, class
> _STL::basic_string<char,struct std::char_traits<char>,class
> _STL::allocator<char> > n="")
>         Sets all the fields of self
> (END)
>>>>
>
>
>
> with the (almost)current cvs :
>
>
>>>> import keywords
>>>> keywords.Foo(.1)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> TypeError: No to_python (by-value) converter found for C++ type: char

Sorry, that MSVC bug obscures our current functionality.  Could you
show the current result with the workaround in place (or use a
different compiler)?

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com





More information about the Cplusplus-sig mailing list