No. Perhaps keep a separate imports_cache dict alongside built, or have built store a tuple (dep_spec, imports).