A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-December/031452.html below:

[Python-Dev] Write All New Import Hooks (PEP 302) in Python, Not C

[Python-Dev] Write All New Import Hooks (PEP 302) in Python, Not C [Python-Dev] Write All New Import Hooks (PEP 302) in Python, Not CJames C. Ahlstrom jim@interet.com
Mon, 30 Dec 2002 11:16:31 -0500
Just van Rossum wrote:

>>It changes the meaning of __import__.
> 
> Where did you get that idea?

I believe the base (unreplaced) __import__ function does
not find hooked imports.
It follows that __import__ will not find modules in zip
archives.

> This is backwards: iu.py implements a superset of PEP 302 (with
> different details). So you have that now.

Which is why I think we should fix iu.py instead of
add more public import hooks.  It is OK with me to
use your import hooks as an internal feature to
implement zip imports.

> PEP 302 allows customizing *parts* of the import mechanism
> without having to deal with most of these pitfalls and complications. It
> allows completely independend components to add hooks that will work
> together seamlessy. This is not true for replacing __import__.

I don't believe PEP 302 provides hooks that work together.  It
provides only one hook for each component of sys.path, and replaces
any hook that was already there.

JimA




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4