gawen / contextvars

Contexted variables framework for Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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"

About

Contexted variables framework for Python


Languages

Language:Python 100.0%