Skip to content
Sharp

Advanced Python · interview question

Which option describes the most likely pitfall around class-based context managers?

Multiple choiceMediumchapter-14-curatedpremiumadvanced-pythonclass-based-context-managers
Choose one answer
Answer and explanation

Correct answer

A. Manual open/close behavior scattered across the codebase is easier to forget and harder to review.

Why

Manual open/close behavior scattered across the codebase is easier to forget and harder to review. Calling out that risk matters because candidates who talk about ownership boundaries sound grounded in real maintenance work.

Test yourself on Advanced Python

A free test with instant, explained results. No account needed.

Start free test
All Advanced Python questions →