[Pythonmac-SIG] Packaging numpy with py2app

Bob Ippolito bob at redivi.com
Wed Jul 19 07:27:04 CEST 2006


On Jul 18, 2006, at 9:16 PM, Robert Kern wrote:

> Josh Marshall wrote:
>> so it seems like the entire purpose of PackageLoader is to make life
>> difficult for me, just to save a few lines of typing. :) Seriously,
>> can a numpy developer tell me why PackageLoader is necessary?
>
> I can't think of a good reason why it's used in __init__.py the way  
> it is (it
> used to have postpone=True). If Pearu, who wrote that bit of code,  
> doesn't speak
> up by Thursday, I'll have it removed in favor of regular imports  
> for the beta.

Note that all you need is the bytecode, it doesn't have to actually  
execute. So you can still use whatever custom import junk if you  
really want to:

def _modulegraph_hints():
     import foo

You should do it in a dead function instead of "if 0" because dead  
functions will never be stripped by the compiler but dead code blocks  
sometimes are.

-bob




More information about the Pythonmac-SIG mailing list