[C++-sig] Re: function::argument_error / overloads & docstrings
dave at boost-consulting.com
Thu Nov 6 05:21:40 CET 2003
Jonathan Brandmeyer <jbrandmeyer at earthlink.net> writes:
> On Mon, 2003-11-03 at 20:34, Nikolay Mladenov wrote:
>> I was also thinking of modifying the signature element to include
>> type_info *(instead of just type_info->name())
>> Then instead of outputing C++ signatures some kind of Python signatures
>> can be generated.
>> I think this would be better since the python programmer generally would
>> not know about the underlying CPP code.
> Since client coders for a C++ -based python extension are either a) only
> familiar with the Python interface, or b) also know the C++ interface
> (and can therefore presumably deduce the underlying C++ types), this
> sounds FANTASTIC to me.
I don't think it's such a hot idea. Some C++ types have directly
corresponding Python types; some don't. The rules for converting a
Python type to a C++ type are not all that straightforward, and may
depend on which converters have been registered. Turning things like
'std::auto_ptr<CppFoo>' into 'PyFoo' can obscure important information
needed to diagnose a problem.
More information about the Cplusplus-sig