We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Sometimes, mostly in tests, I write something like
from contextvars import ContextVar var = ContextVar('var') def test_a(): token = var.set('new val') do_stuff() var.reset(token)
It looks a little cumbersome, the support for with var: would be awesome:
with var:
def test_b(): with var.set('new val'): do_stuff()
This is a minor feature, which does not need previous discussion elsewhere
No response
Feature or enhancement
Proposal:
Sometimes, mostly in tests, I write something like
It looks a little cumbersome, the support for
with var:would be awesome:Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs