[Import-SIG] PEP 382 update? and implementation feedback
ericsnowcurrently at gmail.com
Thu Jul 7 16:36:30 CEST 2011
On Thu, Jul 7, 2011 at 3:39 AM, Eric Smith <eric at trueblade.com> wrote:
> On 7/7/2011 12:35 AM, Eric Snow wrote:
>> My first goal is to help get a proof-of-concept implementation out
>> there for the PEP, for 3.3, regardless of the ultimate implementation.
>> However, my end goal is to leverage that effort into a backported
>> implementation for 2.x. How far back should I go with that? I was
>> thinking 2.4 .
> We (python-dev) can't release a new version of 2.x. That said, I'd love
> it if I could compile a version of 2.5 for my own uses that had this
> feature, or if it could be done as an import hook.
Yeah, any backport that I do would be released on PyPI, as has been
done with things like importlib and distutils2.
>> The import hook approach would not be helpful for 3.3 except as a
>> proof-of-concept. However, the importlib approach could also work as
>> the 3.3 implementation if Brett realizes his intentions for
>> importlib.__import__ .
> Are you thinking of doing the import hook version in C?
Nope. I'm just planning on extending (and backporting) importlib
either indirectly (for the import hook) or directly. With the import
hook it should be easy enough to add it onto sys.meta_path early on.
Same with explicitly changing __import__ to be importlib.__import__.
If I keep the implementation pure Python it would be usable with
Jython, PyPy, and the rest. Also, my Python-fu is much stronger than
my C. Finally, my understanding is that performance is the only gain
for a C version, which does not seem to matter much for imports (hence
Keep in mind that I don't have a vested interest in PEP 382, just in
import features. The PEP and ensuing discussion seem clear enough
that that should not get in the way. However, if the actual use cases
dictate a different approach I'd be glad to reassess.
> Import-SIG mailing list
> Import-SIG at python.org
More information about the Import-SIG