[C++-sig] [Py++] operators() got an unexpected keyword argument 'decl_type'

Roman Yakovenko roman.yakovenko at gmail.com
Sun Jun 14 06:06:20 CEST 2009


On Sat, Jun 13, 2009 at 11:48 AM, Werner
Joergensen<wjoergensen at yahoo.com> wrote:
>
> Hello,
> I need to exclude some operators from my wrapped python classes, but I seem not to be able to access the operators.
>
> What is wrong with this code:
> ----------8<----------
> from pyplusplus import module_builder
> files=["test.H"]
> mb = module_builder.module_builder_t(
>        files=files,
>    )
> print mb.operators()
> ----------8<----------
> (For completeness, test.H contains nothing but "class X{public:  int i(); };"
> The following error, however, occurs independent of test.H.)
>
> On the last line the script produces:
> ----------8<----------
> <type 'exceptions.TypeError'>             Traceback (most recent call last)
> /home/wj/tmp/<ipython console> in <module>()
> /usr/lib/python2.5/site-packages/pyplusplus/module_builder/builder.py in operators(self, name, symbol, return_type, arg_types, decl_type, header_dir, header_file, recursive)
>    541                                          , header_dir=header_dir
>    542                                          , header_file=header_file
> --> 543                                          , recursive=recursive )
>    544
>    545     def member_function( self, name=None, function=None, return_type=None, arg_types=None, header_dir=None, header_file=None, recursive=None ):
> <type 'exceptions.TypeError'>: operators() got an unexpected keyword argument 'decl_type'
> ----------8<----------
>
> The installation is latest gccxml from CVS, pygccxml-1.0.0 and pyplusplus-1.0.0 with python 2.5.2. Same result with python 2.6.
>
> Please help. Is the use of mb.operators() wrong, or what else might be the problem?

The version you use contains such bug. It is fixed in SVN.

If you don't want to upgrade you can use the following code:

mb.global_ns.operators() # query global namespace for all operators


HTH

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


More information about the Cplusplus-sig mailing list