diff options
author | Guido van Rossum <guido@python.org> | 1997-09-06 20:29:52 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-09-06 20:29:52 (GMT) |
commit | f5f5fdbdd05c187dd56e5f36f3e2e7f27948f944 (patch) | |
tree | c51cc96eb6a55ecba89e21e51c70067891aeaad2 /Demo | |
parent | 81da02e6aa7b3400ef06b76c6329cc0cd0216414 (diff) | |
download | cpython-f5f5fdbdd05c187dd56e5f36f3e2e7f27948f944.zip cpython-f5f5fdbdd05c187dd56e5f36f3e2e7f27948f944.tar.gz cpython-f5f5fdbdd05c187dd56e5f36f3e2e7f27948f944.tar.bz2 |
Significant speedup -- when a submodule imports a global module, add a
dummy entry to sys.modules, marking the absence of a submodule by the
same name.
Thus, if module foo.bar executes the statement "import time",
sys.modules['foo.time'] will be set to None, once the absence of a
module foo.time is confirmed (by looking for it in foo's path).
The next time when foo.bar (or any other submodule of foo) executes
"import time", no I/O is necessary to determine that there is no
module foo.time.
(Justification: It may seem strange to pollute sys.modules. However,
since we're doing the lookup anyway it's definitely the fastest
solution. This is the same convention that 'ni' uses and I haven't
heard any complaints.)
Diffstat (limited to 'Demo')
0 files changed, 0 insertions, 0 deletions