https://github.com/willcrichton/context-var
React-style context variables (i.e. dynamic scoping)
https://github.com/willcrichton/context-var
Last synced: 4 months ago
JSON representation
React-style context variables (i.e. dynamic scoping)
- Host: GitHub
- URL: https://github.com/willcrichton/context-var
- Owner: willcrichton
- Created: 2020-03-15T19:54:17.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-15T20:13:33.000Z (over 5 years ago)
- Last Synced: 2025-01-29T22:46:27.791Z (5 months ago)
- Language: Python
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# context-var
[](https://travis-ci.com/willcrichton/context-var)
[](https://badge.fury.io/py/context-var)React-style context management, i.e. dynamically scoped variables. Example:
```python
import context_var as cvvar = cv.ContextVar('hello')
assert var.get() == 'hello'with var.set('world'):
assert var.get() == 'world'assert var.get() == 'hello'
```## Installation
```python
pip install context-var
```