Files
cpython/Python
Brett Cannon 58f5680462 Issue #18810: Be optimistic with stat calls when seeing if a directory
exists when checking for a package.

Before there was an isdir check and then various isfile checks for
possible __init__ files when looking for a package.
This change drops the isdir check by leaning
on the assumption that a directory will not contain something named
after the module being imported which is not a directory. If the module
is a package then it saves a stat call. If there is nothing in the
directory with the potential package name it also saves a stat call.
Only if there is something in the directory named the same thing as
the potential package will the number of stat calls increase
(due to more wasteful __init__ checks).

Semantically there is no change as the isdir check moved
down so that namespace packages continue to have no chance of
accidentally collecting non-existent directories.
2013-10-18 13:24:13 -04:00
..
2013-07-22 22:08:17 -07:00
2013-07-27 02:41:03 +02:00
2012-12-31 21:37:21 -06:00
2013-03-20 00:39:41 -05:00
2012-10-05 01:04:27 +02:00
2013-10-06 18:48:30 +02:00
2013-09-26 22:21:41 -04:00
2013-08-26 14:01:29 +03:00
2013-07-21 13:29:42 -07:00