1
Day 10 homework
j edited this page 2023-04-19 11:45:22 +02:00
This is an extension to the day 9 homework.
First, rebase your branch onto the main branch of this repository: git rebase main.
- Run the module-inspector script, and fix any problems that prevent it from running.
- Look at the output. Notice that some of the module names seem similar, and are cached via two different loader methods.
- Based on what you see from the module-inspector script, modify your answer from question 10 from the day 9 homework, so the similar module names aren't counted multiple times.
- Inspect the
__loader__attribute of each entry in thesys.modulesdict. Can you find an attribute of__loader__which reliably tells you if the loader is source, builtin, or extension? - Add
import pandasto the top of the module-inspector script and re-run it. Notice that many of the pandas modules are not loaded using theSourceFileLoader. Can you explain why these modules are different?
Extra credit: use the freeze utility to turn the module-inspector script into a real app.