[C++-sig] Another bug in pyplusplus

Roman Yakovenko roman.yakovenko at gmail.com
Sun Jun 18 07:44:59 CEST 2006


On 6/18/06, Niall Douglas <s_sourceforge at nedprod.com> wrote:
> If you disable use of keywords using
> mb.calldefs().use_keywords=False, pyplusplus also stops inserting
> default argument values into its wrappers eg;

May I correct you? All wrappers have been generated without default
arguments, right :-)?
It has nothing to do with use_keywords

>     def args_declaration( self ):
>         args = []
>         boost_obj = algorithm.create_identifier( self,
> '::boost::python::object' )
>         for index, arg in enumerate( self.declaration.arguments ):
>             result = arg.type.decl_string + ' ' +
> self.argument_name(index)
>             if arg.default_value:
>                 if not declarations.is_pointer( arg.type ) or
> arg.default_value != '0':
>                     result += '=%s' % arg.default_value
>                 else:
>                     result += '=%s()' % boost_obj

I could be wrong, but it seems to me that we don't need
" if not declarations.is_pointer( arg.type ) or arg.default_value != '0': "
condition, just plain
"result += '=%s' % arg.default_value"
will do the job, right? Am I missing something?

> Another point - I believe the default_X function doesn't need to be
> virtual. By making it so, you're introducing an unnecessary
> inefficiency:

Fixed.

Thank you!

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the Cplusplus-sig mailing list