Question
In Python, which comparison about Context Managers is accurate?
- There is no practical difference in behavior, performance, or maintainability when Context Managers is involved.
- The oldest option related to Context Managers is always the right production choice regardless of workload or context.
- A context manager makes ownership explicit, while manual open/close or acquire/release logic is easier to forget during failure paths.
- Differences around Context Managers are mostly cosmetic, so correctness and debugging quality do not really change.
Hint
Focus on the behavior or tradeoff, not just the keyword.
Answer and rationale
Correct answer: C. A context manager makes ownership explicit, while manual open/close or acquire/release logic is easier to forget during failure paths.
A context manager makes ownership explicit, while manual open/close or acquire/release logic is easier to forget during failure paths. This is the comparison that usually separates memorization from understanding.
Track: Python