python24.zip

Scott David Daniels Scott.Daniels at Acm.Org
Mon May 23 11:04:14 EDT 2005


Martin v. Löwis wrote:
> Dieter Maurer wrote:
> 
>>Really?
>>
>>Is the interpreter unable to call "C" functions ("stat" for example)
>>to determine whether an object exists before it puts it on "path".
> 
> What do you mean, "unable to"? It just doesn't.
In fact, the interpreter doesn't necessarily know when it is
affecting the path.

> Could it? Perhaps, if somebody wrote a patch.
> Would the patch be accepted? Perhaps, if it didn't break something
> else.
> 
> In the past, there was a silent guarantee that you could add
> items to sys.path, and only later create the directories behind
> these items. I don't know whether people rely on this guarantee.

If you only checked "lost" files/directories on the path a few
seconds later than the last time you checked, you might be able
to drive this "failed open" time down drastically without seriously
affecting those who care.  Such an implementation should have a
call which allowed you to "clear" the timestamps for the "known bad"
entries.

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list