Currently, we avoid recomputing the cache when sys.path is appended to OR prepended to, but not both. We can more generally handle the case where the stored sys.path is a contiguous sublist of the new sys.path while traversing only the added directories. The only time we should rebuild the cache is when a directory is removed from sys.path or is inserted in the middle of the list.
Currently, we avoid recomputing the cache when sys.path is appended to OR prepended to, but not both. We can more generally handle the case where the stored sys.path is a contiguous sublist of the new sys.path while traversing only the added directories. The only time we should rebuild the cache is when a directory is removed from sys.path or is inserted in the middle of the list.