Context manager protocol extension (2nd attempt)

I just found this: Yield-based contextmanager for classes

Apparently it would be possible to add this to contextlib with a quite complex implementation, so there is no fundamental need for this being build into the language. Since this is the second time this exact proposal has come up, it’s probably a good idea to add it.

1 Like