[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-distutils-sig
Subject:    [Distutils] Re: [PSA MEMBERS] packages in Python
From:       Fred L. Drake, Jr." <fdrake () acm ! org (Fred L !  Drake)
Date:       1999-05-21 19:55:46
Message-ID: 14149.47682.416406.221941 () weyr ! cnri ! reston ! va ! us
[Download RAW message or body]

Perry A. Stoll writes:
 > Good point. Can you recommend a concise place that the import mechanism (in
 > all it's glory) is documented?

  Documentation?  Ha!  I don't have no stinkin' documentation!  ;-)
  I think going over Python/import.c is the best bet.  There's an
import_package() function (I think that's the name); probably the best 
bet is to modify that to build the right __path__ value; at this point 
we know it's a package, so we're not interfering with the performance
of importing non-packages, only the package/subpackages themselves.

 > That should solve the problem, except for when freeze-ing or making a static
 > python binary (as previously mentioned by Konrad).

  I don't know enough about freezing, but I suspect that's not too
difficult; probably about the same as staticly linked package-ized
modules.  ;-)  I don't think those will actually be that difficult for 
someone that has time to read the code; the only real problem is the
public symbol for the module init function.

 > I was poking around in ihooks.py. It looks like it should be possible to
 > cook up something approximating this using ihooks.  What do you think?

  That can probably be done, but places the import machinery in Python 
rather than in C, so it'll be slow.


  -Fred

--
Fred L. Drake, Jr.	     <fdrake@acm.org>
Corporation for National Research Initiatives


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic