| Store | Cart

Re: [Python-Dev] Does Zip Importer have to be Special?

From: Nick Coghlan <ncog...@gmail.com>
Fri, 25 Jul 2014 06:42:39 +1000
On 25 Jul 2014 03:51, "Brett Cannon" <bre...@python.org> wrote:

> The problem with all of this is you are essentially asking for a hook to
let you have code have access to the interpreter state before it is fully
initialized. Zipimport and the various bits of code that get loaded during
startup are special since they are coded to avoid touching anything that
isn't ready to be used. So if we expose something that allows access prior
to full initialization it would have to be documented as having no
guarantees of interpreter state, etc. so we are not held to some API that
makes future improvements difficult.

Note that this is *exactly* the problem PEP 432 is designed to handle:
separating the configuration of the core interpreter from the configuration
of the operating system interfaces, so the latter can run relatively
normally (at least compared to today).

As you say, though it's a niche problem compared to something like
packaging, which is why it got bumped down my personal priority list. I
haven't even got back to the first preparatory step I identified which is
to separate out our main functions to a separate "Programs" directory so
it's easier to distinguish "embeds Python" sections of the code from the
more typical "is part of Python" and "extends Python" code.

> IOW allowing for easy patching of Python is probably the best option I
can think of.

Yeah, that sounds reasonable - IIRC, Christian ended up going with a
similar "make it patch friendly" approach for the hashing changes, rather
than going overboard with configuration options.

Cheers,
Nick.

_______________________________________________
Python-Dev mailing list
Pyth...@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: https://mail.python.org/mailman/options/python-dev/python-dev-ml%40activestate.com

Recent Messages in this Thread
Phil Thompson Jul 24, 2014 04:55 pm
Brett Cannon Jul 24, 2014 05:48 pm
Phil Thompson Jul 24, 2014 06:12 pm
Brett Cannon Jul 24, 2014 06:26 pm
Phil Thompson Jul 25, 2014 09:36 am
Nick Coghlan Jul 24, 2014 08:42 pm
Phil Thompson Jul 25, 2014 09:33 am
Nick Coghlan Jul 25, 2014 12:30 pm
Messages in this thread