Re: [Python-Dev] Clarifications for import PEPs (302 and 328)

2007-04-24 Thread Brett Cannon
On 4/23/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 04:23 PM 4/23/2007 -0700, Brett Cannon wrote: > >On 4/23/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > > > At 03:16 PM 4/23/2007 -0700, Brett Cannon wrote: > > > >The PEP does not explicitly state how to signal that a loader cannot > > >

Re: [Python-Dev] Clarifications for import PEPs (302 and 328)

2007-04-24 Thread Paul Moore
On 24/04/07, Brett Cannon <[EMAIL PROTECTED]> wrote: > Not if you read the PEP. It doesn't explicitly say what should happen. > > I want to standardize on raising ImportError. The PEP itself has two > ways of signaling an error; find_module() returns None instead of > raising an error to signal i

Re: [Python-Dev] Clarifications for import PEPs (302 and 328)

2007-04-23 Thread Phillip J. Eby
At 04:23 PM 4/23/2007 -0700, Brett Cannon wrote: >On 4/23/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > > At 03:16 PM 4/23/2007 -0700, Brett Cannon wrote: > > >The PEP does not explicitly state how to signal that a loader cannot > > >load a module it is asked to. This could happen if someone cal

Re: [Python-Dev] Clarifications for import PEPs (302 and 328)

2007-04-23 Thread Brett Cannon
On 4/23/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 03:16 PM 4/23/2007 -0700, Brett Cannon wrote: > >The PEP does not explicitly state how to signal that a loader cannot > >load a module it is asked to. This could happen if someone called a > >loader without consulting its respective import

Re: [Python-Dev] Clarifications for import PEPs (302 and 328)

2007-04-23 Thread Phillip J. Eby
At 03:16 PM 4/23/2007 -0700, Brett Cannon wrote: >The PEP does not explicitly state how to signal that a loader cannot >load a module it is asked to. This could happen if someone called a >loader without consulting its respective importer. I would want to >add something like: >""" >If the loader

Re: [Python-Dev] Clarifications for import PEPs (302 and 328)

2007-04-23 Thread Brett Cannon
On 4/23/07, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 02:01 PM 4/23/2007 -0700, Brett Cannon wrote: > >For PEP 302, a loader should raise ImportError if load_module fails > >w/o an explicit exception being raised. > > I'm not sure I understand this; could you point to the relevant part of the

Re: [Python-Dev] Clarifications for import PEPs (302 and 328)

2007-04-23 Thread Phillip J. Eby
At 02:01 PM 4/23/2007 -0700, Brett Cannon wrote: >For PEP 302, a loader should raise ImportError if load_module fails >w/o an explicit exception being raised. I'm not sure I understand this; could you point to the relevant part of the PEP and what you would be adding? Thanks. (The rest of your

[Python-Dev] Clarifications for import PEPs (302 and 328)

2007-04-23 Thread Brett Cannon
After my import rewrite, I discovered some things that were left out of both PEP 302 (import hooks) and PEP 328 (absolute/relative imports). I wanted to run them by everyone before I made the subsequent changes to the PEPs. For PEP 302, a loader should raise ImportError if load_module fails w/o a