[Python-Dev] New Import Hooks PEP, a first draft (and req. for PEP #)

Aahz aahz@pythoncraft.com
Fri, 20 Dec 2002 09:02:34 -0500


On Fri, Dec 20, 2002, Fredrik Lundh wrote:
>
> if you have a valid argument for using return values instead of
> exceptions (it's not like people will be installing thousands of
> hooks, so it's not obvious what the problem is), is there any reason
> not to allow people to use *any* callable object that can return a
> value? (including three-line wrappers for pre-2.2 classes).

Good point.  That should go in the PEP.  

(In case it wasn't clear, I was arguing neither for nor against
new-style classes, I just wanted it documented in the PEP since it was
discussed.)

Hmmmm....  I seem to also recall seeing discussion about the callable
raising something other than ImportError when it just can't handle a
path element.  What happened to that idea?  That would allow the hook
handler to distinguish between "I had an error in handling this path"
and "I can't handle this path".
-- 
Aahz (aahz@pythoncraft.com)           <*>         http://www.pythoncraft.com/

"To me vi is Zen.  To use vi is to practice zen.  Every command is a
koan.  Profound to the user, unintelligible to the uninitiated.  You
discover truth everytime you use it."  --reddy@lion.austin.ibm.com