makepy generating a file versus a directory

Mark Hammond mhammond at keypoint.com.au
Thu Apr 29 10:30:28 EDT 2004


Olaf Meding wrote:
> When does the makepy utility generate a .py file and when a directory?
>  And what decided if a directory or a file is generated?

Whenever 'bForDemand' is passed to the gencache/makepy functions. 
Currently EnsureDispatch passes True here.

> What is the difference between a file and a directory (both named
> after the uuid in the IDL file)?

I am moving towards the directory version.  In this case, only the 
package itself (with the __init__.py) is generated when the tlb is 
loaded.  Interfaces etc referenced in the typelib are then generated 'on 
demand', as they are referenced.

The benefit is for huge type-libraries, when only one or 2 interfaces 
are used.  A good example is Excel - often you just use 2 or 3 
interfaces, but the .tlb, and generated .py file, is huge.  The cost of 
bringing in the .pyc can be quite high for these typelibs, let alone the 
generation of it first time around.

Mark.



More information about the Python-list mailing list