[C++-sig] pyste and big files

Nicodemus nicodemus at globalite.com.br
Sun Mar 30 03:23:59 CEST 2003


Niki Spahiev wrote:

> I got msvc internal overflow with pyste generated files. Can pyste 
> write separate finctions for each class?

I don't understand what you mean by "functions for each class", but you 
can always generate various little modules, one for each pyste file if 
you want. If you're using a single pyste file for the entire library, 
break it into smaller ones, one for each submodule your library has (or 
any other criteria you find appropriate). Note that you can still access 
the library in Python as a single module:

pyste --module=sub_module1 sub_module1.pyste
pyste --module=sub_module2 sub_module2.pyste
pyste --module=sub_module3 sub_module3.pyste

(Each sub_module is a subset of your library called here "library" ;))

Then you create a "library.py", which imports the sub modules:

# file library.py
from sub_module1 import *
from sub_module2 import *
from sub_module3 import *


And then as a user:

 >>> import library
 >>> # use library normally

Which is the same as:

pyste --module=library library.pyste

 >>> import library
 >>> # use library normally too

Which I believe it's what you're doing right now.

I recommend this approach anyway for large libraries, even if you're not 
having the problems you're describing.

HTH,
Nicodemus.






More information about the Cplusplus-sig mailing list