[Python-Dev] Zipping Zope3 (original) (raw)
Jack Jansen Jack.Jansen@oratrix.com
Wed, 18 Dec 2002 22:50:02 +0100
- Previous message: [Python-Dev] Zipping Zope3
- Next message: [Python-Dev] Zipping Zope3
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On woensdag, dec 18, 2002, at 16:55 Europe/Amsterdam, Just van Rossum wrote:
The new import hooks are not easily integrated in the existing imp.findmodule() and imp.loadmodule() calls. It's questionable whether it's possible at all without breaking code; it is better to simply add a new function to the imp module. The meaning of the existing imp.findmodule() and imp.loadmodule() calls changes from: "they expose the builtin import mechanism" to "they expose the basic unhooked builtin import mechanism". They simply won't invoke any import hooks. A new imp module function is proposed under the name "findmodule2", with is used like the following pattern:
loader = imp.findmodule2(fullname, path) if loader is not None: loader.loadmodule(fullname)
If we want to use this for freeze-like functionality then the loader will also need a method (or methods) that at the very least return (for modules for which it makes sense) either the source code for the module or a file-like object that can be used to read the source code.
- Jack Jansen <Jack.Jansen@oratrix.com>
http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman -
- Previous message: [Python-Dev] Zipping Zope3
- Next message: [Python-Dev] Zipping Zope3
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]