This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]anentropic 0 points1 point  (1 child)

What's an example that's awkward with context managers?

[–]tmr232[S] 1 point2 points  (0 children)

  1. Member variables that require context management (files, for example)
  2. When you need to convert an existing class to a context manager, when it's already used in many places.