Re: [Python-Dev] difficulty of implementing phase 2 of PEP 302 in Python source

2006-10-01 Thread Armin Rigo
Hi Brett, On Wed, Sep 27, 2006 at 02:11:30PM -0700, Brett Cannon wrote: > is so bad that it is worth trying to re-implement the import semantics in > pure Python or if in the name of time to just work with the C code. In the name of time, sanity and usefulness, rewriting the expected semantics in

Re: [Python-Dev] difficulty of implementing phase 2 of PEP 302 in Python source

2006-09-28 Thread Paul Moore
> Phillip J. Eby schrieb: > > I would say that the C code is *delicate*, not necessarily bad. In most > > ways, it's rather straightforward, it's actually the requirements that are > > complex. :) >From what I recall, that's right. The C code's main disadvantage is that it isn't very well comme

Re: [Python-Dev] difficulty of implementing phase 2 of PEP 302 in Python source

2006-09-28 Thread Thomas Heller
Phillip J. Eby schrieb: > At 11:25 AM 9/28/2006 -0700, Brett Cannon wrote: >>I will think about it, but I am still trying to get the original question >>of how bad the C code is compared to rewriting import in Python from >>people. =) > > I would say that the C code is *delicate*, not necessari

Re: [Python-Dev] difficulty of implementing phase 2 of PEP 302 in Python source

2006-09-28 Thread Phillip J. Eby
At 11:25 AM 9/28/2006 -0700, Brett Cannon wrote: >I will think about it, but I am still trying to get the original question >of how bad the C code is compared to rewriting import in Python from >people. =) I would say that the C code is *delicate*, not necessarily bad. In most ways, it's rath

Re: [Python-Dev] difficulty of implementing phase 2 of PEP 302 in Python source

2006-09-28 Thread Brett Cannon
On 9/27/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: At 05:26 PM 9/27/2006 -0700, Brett Cannon wrote:>Ah, OK.  So for importing 'email', the zipimporter would call the .pyc>importer and it would ask the zipimporter, "can you get me email.pyc?" and >if it said no it would move on to asking the .py

Re: [Python-Dev] difficulty of implementing phase 2 of PEP 302 in Python source

2006-09-27 Thread Phillip J. Eby
At 05:26 PM 9/27/2006 -0700, Brett Cannon wrote: >Ah, OK. So for importing 'email', the zipimporter would call the .pyc >importer and it would ask the zipimporter, "can you get me email.pyc?" and >if it said no it would move on to asking the .py importer for email.py, etc. Yes, exactly. >That

Re: [Python-Dev] difficulty of implementing phase 2 of PEP 302 in Python source

2006-09-27 Thread Brett Cannon
On 9/27/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: At 04:11 PM 9/27/2006 -0700, Brett Cannon wrote:>On 9/27/06, Phillip J. Eby><[EMAIL PROTECTED]>[EMAIL PROTECTED] > wrote:>>At 02:11 PM 9/27/2006 -0700, Brett Cannon wrote:>> >But it has been suggested here that the import machinery be rewritten

Re: [Python-Dev] difficulty of implementing phase 2 of PEP 302 in Python source

2006-09-27 Thread Phillip J. Eby
At 04:11 PM 9/27/2006 -0700, Brett Cannon wrote: >On 9/27/06, Phillip J. Eby ><[EMAIL PROTECTED]> wrote: >>At 02:11 PM 9/27/2006 -0700, Brett Cannon wrote: >> >But it has been suggested here that the import machinery be rewritten in >> >Python. Now I have never touched

Re: [Python-Dev] difficulty of implementing phase 2 of PEP 302 in Python source

2006-09-27 Thread Brett Cannon
On 9/27/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: At 02:11 PM 9/27/2006 -0700, Brett Cannon wrote:>But it has been suggested here that the import machinery be rewritten in>Python.  Now I have never touched the import code since it has always had>the reputation of being less than friendly to wor

Re: [Python-Dev] difficulty of implementing phase 2 of PEP 302 in Python source

2006-09-27 Thread Phillip J. Eby
At 02:11 PM 9/27/2006 -0700, Brett Cannon wrote: >But it has been suggested here that the import machinery be rewritten in >Python. Now I have never touched the import code since it has always had >the reputation of being less than friendly to work with. I am asking for >opinions from people w

[Python-Dev] difficulty of implementing phase 2 of PEP 302 in Python source

2006-09-27 Thread Brett Cannon
I am at the point with my security work that I need to consider how I am going to restrict importing modules.  My current plan is to basically implement phase 2 of PEP 302 and control imports through what importer objects are provided.  This work should lead to a meta_path importer for built-ins an