Update page 'Day 10 homework - Sloetjes '
@@ -81,8 +81,7 @@ 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?**
|
**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:
|
##### Answer: Yes, the attribute name of the loader object can be used to determine if the loader is source, builtin, or extension.
|
||||||
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 '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.
|
* If the name attribute is 'extension', it means that the module is a compiled extension module.
|
||||||
|
|||||||
Reference in New Issue
Block a user