Brett Cannon wrote:
> Actually it's four: name/__init__.py, name/__init__.pyc, name.py, and
> then name.pyc. And just so people have terminology to go with all of
> this, this search is what the finder does to say whether it can or
> cannot handle the requested module.

Huh, I thought we checked for the directory first and only then checked
for the __init__ module within it (hence the generation of ImportWarning
when we don't find __init__ after finding a correctly named directory).
So a normal miss (i.e. no directory) only needs one stat call.

(However, I'll grant that I haven't looked at this particular chunk of
code in a fairly long time, so I could easily be wrong).

Robert raises a good point about the checks for extension modules as
well - we should get an accurate count here so Barry's PEP can pitch the
proportional reduction in stat calls accurately.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to