[C++-sig] Boost.Python Feature Request

Nicodemus nicodemus at esss.com.br
Fri Jan 16 20:42:02 CET 2004


Hi Jenna,

Jenna Louis wrote:

 > Are there any patches or plans to add the following features to 
Boost.Python/Pyste?
 > 3. I often generate modules that require  a very specific order of 
initialization for the proxies it contains. I often have to rearrange 
the _main.cpp's BOOST_PYTHON_MODULE code as depicted below to get my 
module to work.
 > 
 > This:
 >
 > BOOST_PYTHON_MODULE(Sim)
 >
 > {
 >
 > Export_SzCoordPos();
 >
 > Export_SzCoordAng();
 >
 > Export_SzCoord();
 >
 > Export_SzMath();
 >
 > Export_SzPolyUtils()
 >
 > }
 > To This:
 > 
 > 
 >
 > BOOST_PYTHON_MODULE(Sim)
 >
 > {
 >
 > Export_SzCoord();
 >
 > Export_SzMath();
 >
 > Export_SzPolyUtils()
 >
 > Export_SzCoordPos();
 >
 > Export_SzCoordAng();
 >
 > }
 >
 > It would be nice if this list would be generated in the order in 
which the pyste files are specified on the command line.

The order of the function takes in account inheritance (base classes 
must be instantiated first), but modules with no relacionship are 
arbitrary... I will think about it.


 > 4. I would like a way to add pickling code to my class from pyste. I 
realize its not practical to generate this code automatically but I 
would at least like to be able to inline this in my pyste file. I can 
already insert code into the proxy with the declaration_code() feature 
to handle the pickle struct but I also need to be able to add a pickle 
method i.e.(".def_pickle(world_pickle_suite())"  to the class definition 
I specify.
 >

I guess we need a class_code(class, code) function for that.

Unfortunately, I have very little time right now to work on Pyste, and I 
have a set of patches by Niall Douglas and Mike Owen (sorry Mike, 
haven't had time yet! 8( ) that have priority to be applied, so it might 
take awhile to see this changes... but I will announce here whenever 
it's ready.

Thanks for the feedback!
Nicodemus.
 





More information about the Cplusplus-sig mailing list