Skip to content

Latest commit

 

History

History
19 lines (11 loc) · 291 Bytes

README.md

File metadata and controls

19 lines (11 loc) · 291 Bytes

contextvars

contextvars is a Python module to manage contexted variables.

Examples

from contextvars import *

c = ContextStack()

c.foo = "foo"
with c:
    assert c.foo == "foo"

    c.foo = "bar"

    assert c.foo == "bar"

assert c.foo == "foo"