[C++-sig] exclude an entire class with pyste ?

Nicodemus nicodemus at globalite.com.br
Tue Apr 22 01:23:17 CEST 2003


Dominique Devriese wrote:

>Hi,
>I'm working on playing around with embedding python in my application
>using Boost.Python for exposing the API.  This is going really great,
>I hadn't imagined it being so easy.  Boost.python is certainly
>somewhere at the top in my list of great libraries ( together with
>most of the rest of Boost, actually :) ). 
>
>Anyway, I'd like to use pyste for generating some of the relevant
>code.  I have a header containing a lot of free functions like 
>Point calcCircleCenter( const Point& a, const Point& b,const Point& c );
>and it would be really convenient to use pyste here, cause there are a
>*lot* of these functions.
>However, there is the problem that in front of the header, I have
>class declarations like
>class SomeClass;
>
>and when pyste sees this, it outputs code like
>    class_< SomeClass, boost::noncopyable >("SomeClass", no_init)
>    ;
>which is not what I want, since SomeClass is in another header, and
>also being exported to python.  So my question basically is, is there
>a way to exclude an entire class from the pyste output, since
>ch = AllFromHeader( "some_header.h" );
>exclude( ch.SomeClass );
>doesn't seem to do the trick..
>

Indeed, that is a "misfeature" of pyste, because it shouldn't export 
forward declared classes at all. I believe the desired behaviour would 
be to show a warning in case the user tries to export an forward 
declared class explicitly (using "Class"), or silently ignore them when 
the AllFromHeader construct is used.

The fact that you can't exclude a class is a bug too.

I will work on this. Thanks for the feedback Dominique!

Regards,
Nicodemus.







More information about the Cplusplus-sig mailing list