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/2013-October/129698.html below:

[Python-Dev] possibility of shaving a stat call from imports

[Python-Dev] possibility of shaving a stat call from imports [Python-Dev] possibility of shaving a stat call from importsBrett Cannon brett at python.org
Fri Oct 18 18:53:55 CEST 2013
importlib.machinery.FileFinder does a stat call to check if a path is a
file if the package check failed. Now I'm willing to bet that the check is
rather redundant as the file extension should be a dead give-away that
something in a directory is a file and not some non-file type. The import
would still fail even if this is the case in the loader when attempting to
read from the file, but it happens a little later and it means finders
would be more permissive in claiming they found a loader.

Does anyone see a good reason not to take the more optimistic route in the
finder? As I said, the only thing I see breaking user code is if they have
a directory or something named spam.py and so the finder claims it found a
module when in fact it didn't and thus stopping the search for the module
from continuing.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20131018/c58686ea/attachment.html>
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