Skip to content
Sharp

Advanced Python · interview question

A teammate submits shaky class-based context managers code. Which review comment is the strongest?

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

Correct answer

B. Make the rule clearer and easier to explain. Use context managers when a block of work must clearly acquire and release a resource or scope.

Why

The best review comment anchors the change to readability, correctness, and future maintenance. Manual open/close behavior scattered across the codebase is easier to forget and harder to review.

Test yourself on Advanced Python

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

Start free test
All Advanced Python questions →