A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2007-August/074280.html below:

[Python-Dev] PEP 302 optional extensions only for loaders?

[Python-Dev] PEP 302 optional extensions only for loaders? [Python-Dev] PEP 302 optional extensions only for loaders?Brett Cannon brett at python.org
Thu Aug 23 22:38:36 CEST 2007
When you read PEP 302 and the section on the optional extensions, it
mentions that they "are highly recommended for general purpose
importers".  But then the PEP says very shortly thereafter that
"loader objects" are to have the extensions.

So which is it, importers or loaders?  The reason I ask is because if
one can assume that the extensions are only called on what find_module
returns, and thus extensions are only called on loaders, then some
caching can be done based on what find_module had to do.  In my case I
am reimplementing zipimport and if I can assume find_module was called
before is_package I can just cache in the object what module names
were found to be a package and then have is_package just be a lookup
in a set instead of having to read the zip file every time or store
all of the ZipInfo files for the zipfile.

-Brett
More information about the Python-Dev mailing list

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