[C++-sig] Lost Again! :)

Roman Yakovenko roman.yakovenko at gmail.com
Thu Aug 31 19:33:02 CEST 2006


On 8/31/06, Nicolas Tessore <wz_ at gmx.net> wrote:
> I built a python script that dynamically creates a header file including
> all the libraries from one folder. Fortunately, each class is contained
> in one single header called <classname>.h, so that creating the template
> typedefs and instantiations work fine.

:-)

> Now my understanding is still lacking with respect to template functions:
> I followed the howto-advise and call every function once for
> instantiation. This works, however I need to control the name that
> function later has in Python. At the moment I use function pointers (I
> could not find something like typedef), but they don't seem to make
> their way into the Boost.Python binding file.

Please read these tutorials:
http://language-binding.net/pyplusplus/documentation/tutorials/module_builder/module_builder.html

> ---
>
> Now something from my tests: I noticed I often get a error like
>
>      super(type, obj): obj must be instance or subtype of type.
>
> from a condition in decl_wrappers/calldef_wrapper.py (line 309).
> However, running your GUI utility for a test, this error never occurs.
> What is my mistake?

I am not sure that this is your mistake. Can you create small script that
reproduce the error?

> ---
>
> Another problem arises when I try to build an example I created for my
> lib: I always run into
>
>      'boost::python::init' : too many template arguments
>
> errors. I had no time to dive deeper into Boost.Python, anyone up for a
> quick heads-up?

You don't read Py++ warnings, right?

  The function has more than %d arguments ( %d ).
  You should adjust BOOST_PYTHON_MAX_ARITY macro.
  For more information see:
http://mail.python.org/pipermail/c++-sig/2002-June/001554.html

You should find this message in your output script, where first %d
will be 10, and second %d will
contain actual number of arguments.

Please read them, you will save a lot of time.

> ---
>
> This is all :D I really appreciate your efforts in helping out, and I am
> confident Py++ results will soon overtake Swig and pay off the time
> invested.

We will see.


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



More information about the Cplusplus-sig mailing list