python24.zip

"Martin v. Löwis" martin at v.loewis.de
Mon May 23 13:32:09 EDT 2005


Scott David Daniels wrote:
>>> 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.

Now I remember what makes this stuff really difficult: PEP 302
introduces path hooks (sys.path_hooks), allowing imports from
other sources than files. So the items on sys.path don't have
to be directory or file names at all, and importing from them
may still succeed if though stat fails.

Regards,
Martin



More information about the Python-list mailing list