From 47197a9b0685cc661f12bdbb22a03328b3be97d5 Mon Sep 17 00:00:00 2001 From: j Date: Wed, 19 Apr 2023 11:45:22 +0200 Subject: [PATCH] Update page 'Day 10 homework' --- Day 10 homework.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Day 10 homework.md diff --git a/Day 10 homework.md b/Day 10 homework.md new file mode 100644 index 0000000..2f7fc63 --- /dev/null +++ b/Day 10 homework.md @@ -0,0 +1,11 @@ +This is an extension to the day 9 homework. + +First, rebase your branch onto the main branch of this repository: `git rebase main`. + +1. Run the module-inspector script, and fix any problems that prevent it from running. +2. Look at the output. Notice that some of the module names seem similar, and are cached via two different loader methods. +3. 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. +4. Inspect the `__loader__` attribute of each entry in the `sys.modules` dict. Can you find an attribute of `__loader__` which reliably tells you if the loader is source, builtin, or extension? +5. Add `import pandas` to the top of the module-inspector script and re-run it. Notice that many of the pandas modules are not loaded using the `SourceFileLoader`. Can you explain why these modules are different? + +Extra credit: use the freeze utility to turn the module-inspector script into a real app. \ No newline at end of file