From 95e66c50411c6b197bc18ab5733cea93119c83c2 Mon Sep 17 00:00:00 2001 From: "xuanyi.wang" Date: Wed, 19 Apr 2023 19:20:46 +0200 Subject: [PATCH] Update page 'Day 10 homework - Sloetjes ' --- Day 10 homework - Sloetjes .md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Day 10 homework - Sloetjes .md b/Day 10 homework - Sloetjes .md index 911fb1d..d927a64 100644 --- a/Day 10 homework - Sloetjes .md +++ b/Day 10 homework - Sloetjes .md @@ -81,6 +81,13 @@ By using a set called `module_files` to keep track of the filenames of the modul **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?** +##### Answer: +Yes, the attribute name of the loader object can be used to determine if the loader is source, builtin, or extension. + +* If the name attribute is 'built-in', it means that the module is a built-in module. +* If the name attribute is 'extension', it means that the module is a compiled extension module. +* Otherwise, the module is a source module. + **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