[pygccxml-development] Py++ generates wrappers for final classes
Brought to you by:
mbaas,
roman_yakovenko
|
From: Julian S. <jul...@rs...> - 2007-07-09 04:58:19
|
Hello,
I've run into a problem with Py++ (both with 0.9.0 and with trunk) when
trying to expose a class like this:
class Foo
{
public:
virtual void bar() {}
private:
Foo() {}
};
Py++ will generate a wrapper for Foo (since it contains a virtual
function) when it shouldn't. Firstly, the generated code will not
compile because the wrapper is derived from Foo and Foo cannot be used
as a base class (Foo is final because it has no public or protected
constructors.)
And it doesn't make sense to generate a wrapper for Foo in the first
place because Foo is final, and so function bar() cannot be overridden
anyway.
In the long term, I guess the proper fix is to not create wrappers for
final classes. Is there a short-term workaround for this problem? I
tried using finalize() from goodie_utils but that didn't work unfortunately.
Thanks,
Julian
|