[C++-sig] pyplusplus: Feature requests

Allen Bierbaum abierbaum at gmail.com
Mon Feb 27 03:34:15 CET 2006


On 2/26/06, Matthias Baas <baas at ira.uka.de> wrote:

>
> - Are there any plans on adding some support for creating wrapper
> methods in cases where they are absolutely necessary? Suppose you have a
> method void getSize(int& width, int& height) that returns the resolution
> of an image. pyplusplus currently wraps that method happily without
> issuing a warning, but I'm not even able to call that function from
> Python, let alone will it ever do what it's supposed to do. I don't
> expect pyplusplus to deal with such cases in a fully automated manner
> (as to date, reading the user's mind is still out of scope of such tools
> ;) but it could help the user resolve these things. A minimal aid would
> simply be to report such methods that might not work in Python so that
> the user knows he has to do something about it. Maybe for some cases we
> could provide some automatic wrapper generation once the user has
> specified which arguments are actually output values and shouldn't be
> part of the argument list in Python.

I like this idea a lot.  This could cover a wide range of cases where
I currently have to add wrappers.  If it was possible to tell the
pyplusplus creator what arguments should be returned I think we could
extend the evolving high-level APIs to provide a nice user interface
to this type of generation.

Other pyplusplus feature requests or bug reports:

- Currently pyplusplus generates invalid bindings on class with
virtual methods and static methods.  It tries to add the static
methods to the wrapper and things just don't work out well.  IIRC the
code doesn't even compile.

- Type traits:  I noticed when using the pygccxml type traits to test
a type for const'ness that the current code only tests the most
external type wrapper and thus doesn't really tell you if the entire
type is const.

for example a type in pygccxml may end up looking like: ref( const(
ptr( float))))

This type would only return true when tested for is_reference. 
is_const would fail.  This is inconvenient and doesn't reflect the way
boost.type_traits works on types.  I think it could be solved by just
making the type traits methods process the type recursively.

- finalizing:  Are there known issues with finalizing a class?  I have
run into multiple cases where I was able to finalize a class with
Pyste but pyplusplus returns an error when attempting to finalize it. 
(I don't have a self contained example right now but I may be able to
come up with one if needed)

Thanks,
Allen



More information about the Cplusplus-sig mailing list