Question
Which statement about Import System and sys.modules is the strongest interview answer?
- Import System and sys.modules is mostly a naming style choice and has little effect on runtime behavior or design tradeoffs.
- Python caches imported modules in sys.modules so repeated imports usually reuse the existing module object rather than reloading it from disk.
- Import System and sys.modules exists mainly to reduce the number of files in a Python project.
- Import System and sys.modules matters only for frontend scripting and not for backend or automation code.
Hint
Start with the core rule behind Import System and sys.modules.
Answer and rationale
Correct answer: B. Python caches imported modules in sys.modules so repeated imports usually reuse the existing module object rather than reloading it from disk.
Python caches imported modules in sys.modules so repeated imports usually reuse the existing module object rather than reloading it from disk. This is the base concept interviewers commonly test first.
Track: Python