Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/willcrichton/context-var
React-style context variables (i.e. dynamic scoping)
https://github.com/willcrichton/context-var
Last synced: 23 days 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 (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-15T20:13:33.000Z (almost 5 years ago)
- Last Synced: 2024-10-22T11:35:09.964Z (2 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
[![Build Status](https://travis-ci.com/willcrichton/context-var.svg?branch=master)](https://travis-ci.com/willcrichton/context-var)
[![PyPI version](https://badge.fury.io/py/context-var.svg)](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
```