[C++-sig] Re: Problem with current pyste and inheritance

GameGuy gameguy at eastlink.ca
Mon Feb 16 16:18:00 CET 2004


I'm not sure if this is related, but I found another inheritance problem:

Attached are the files necessary to reproduce:
	2 classes: A and B.
	B is derived from A.
	A defines a method, getA, to illustrate the point more clearly.
		The method is not necessary to reproduce the problem.



If I only put B.pyste in the pyste command line specifying "--multiple", PYSTE won't output the 
proper bases<A> in the class_ definition, and it redefines all of A's member definitions (as though 
it's ignoring the 'Import("A.pyste")' declaration in B.pyste).  But if both A.pyste and B.pyste are 
specified in the same command line the proper output is achieved.


% pyste --multiple B.pyste
// outputs B.cpp erroneously:

// Module ======================================================================
void Export_B()
{
     class_< B >("B", init<  >())
         .def(init< const B& >())
         .def("getA", &A::getA, return_value_policy< copy_const_reference >())
     ;

}


% pyste --multiple A.pyste B.pyste
// outputs B.cpp properly:

// Module ======================================================================
void Export_B()
{
     class_< B, bases< A >  >("B", init<  >())
         .def(init< const B& >())
     ;

}



BTW, is there an online PYSTE bug repository?  Bugzilla?  Or is this the proper forum for PYSTE bug 
reports?

Cheers,
~Shaun



Nicodemus wrote:
> Gideon May wrote:
> 
>> Hi,
>>
>> I've got a C++ class hierarchy which looks like this:
>>
>> Base
>>  ^
>>  |
>> Derived
>>  ^
>>  |
>> Sub
>>
>> and I want to use pyste to generate python bindings.
>> I've got it working except for the fact that the bindings
>> for Derived are being defined twice by pyste.
>> I've attached the include files and pyste files. I generate
>> the code with the following command:
>>  pyste --module=double Base.pyste Derived.pyste Sub.pyste
>>
>> Any suggestions ?
> 
> 
> 
> Hi Gideon,
> 
> I don't have time right now to look at this, but seems like a bug. I 
> will take a look ASAP. Thanks!
> 
> Regards,
> Nicodemus.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: A.h
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20040216/d5d32285/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: A.pyste
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20040216/d5d32285/attachment-0001.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: B.h
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20040216/d5d32285/attachment-0002.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: B.pyste
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20040216/d5d32285/attachment-0003.txt>


More information about the Cplusplus-sig mailing list