
On Wed, Sep 6, 2017 at 11:55 PM, Greg Ewing <greg.ewing@canterbury.ac.nz> wrote:
Guido van Rossum wrote:
Yeah, so my claim this is simply a non-problem, and you've pretty much just proved that by failing to come up with pointers to actual code that would suffer from this. Clearly you're not aware of any such code.
In response I'd ask Yuri to come up with examples of real code that would benefit significantly from being able to make context changes without wrapping them in a with statement.
A real-code example: make it possible to implement decimal.setcontext() on top of PEP 550 semantics. I still feel that there's some huge misunderstanding in the discussion: PEP 550 does not promote "not using context managers". It simply implements a low-level mechanism to make it possible to implement context managers for generators/coroutines/etc. Whether this API is used to write context managers or not is completely irrelevant to the discussion. How does threading.local() promote or demote using of context managers? The answer: it doesn't. Same answer is for PEP 550, which is a similar mechanism. Yury