[Python-Dev] Importing .pyc in -O mode and vice versa (original) (raw)

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Nov 8 02:38:28 CET 2006


Delaney, Timothy (Tim) wrote:

Would it be reasonable to always do a stat() on the directory, reloading if there's been a change? Would this be reliable across platforms?

To detect a new shadowing you'd have to stat all the directories along sys.path, not just the one you think the file is in. That might wipe out most of the advantage.

It would be different on platforms which provide a way of "watching" a directory and getting notified of changes. I think MacOSX, Linux and Windows all provide some way of doing that nowadays, although I'm not familiar with the details.

-- Greg



More information about the Python-Dev mailing list