[Python-Dev] Inconsistent behaviour in import/zipimport hooks

Guido van Rossum guido at python.org
Thu Nov 10 02:51:19 CET 2005


On 11/9/05, Brett Cannon <bcannon at gmail.com> wrote:
> On 11/9/05, Guido van Rossum <guido at python.org> wrote:
> > > > I like Phillip's suggestion -- no new opcode, just a conditional jump
> > > > that can be easily optimized out.
> > >
> > > Huh?  But Phillip is suggesting a new opcode that is essentially the
> > > same as my proposal but naming it differently and saying the bytecode
> > > should get changed directly instead of having the eval loop handle the
> > > semantic differences based on whether -O is being used.
> >
> > Sorry.
>
> No problem.  Figured you just misread mine.
>
> > Looking back they look pretty much the same to me. Somehow I
> > glanced over Phillip's code and thought he was proposing to use a
> > regular JUMP_IF opcode with the special __debug__ variable (which
> > would be a 3rd possibility, good if we had backwards compatibility
> > requirements for bytecode -- which we don't, fortunately :-).
> >
>
> Fortunately.  =)
>
> So does this mean you like the idea?  Should this all move forward somehow?

I guess so. :-)

It will need someone thinking really hard about all the use cases,
edge cases, etc., implementation details, and writing up a PEP. Feel
like volunteering? You might squeeze Phillip as a co-author. He's a
really good one.

--
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list