Access the value of a variable in a higher stack frame
Project description
Uplevel
Access the values of variables in the parent scope.
Installation
pip install uplevel
Usage
Here is a short example of how to use uplevel
:
import uplevel
x = 3
def foo():
return uplevel.upvar(1, 'x')
print(foo()) # 3
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
uplevel-0.0.1.tar.gz
(1.8 kB
view details)
Built Distribution
File details
Details for the file uplevel-0.0.1.tar.gz
.
File metadata
- Download URL: uplevel-0.0.1.tar.gz
- Upload date:
- Size: 1.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e857d3000bafdb6161c73c694f3f049c1f8e2527d25980661bbae91a3c90c9a |
|
MD5 | a95cad9a1c8306a70f73004f2bb44a10 |
|
BLAKE2b-256 | 4589406bb37faf3e61bdc4a0fddaf5ffadb81b5955dd29498378af74a45c2b4e |
File details
Details for the file uplevel-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: uplevel-0.0.1-py3-none-any.whl
- Upload date:
- Size: 1.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a3e2de8fba388538d00d5619c88b103ca3f39e734c5b2381f89c825c71ce655 |
|
MD5 | 6eafcfb1276c8893e61c5fb0b892273c |
|
BLAKE2b-256 | 69765ddc8fbc870f8730a40a0969c973a16b56b333e0bbe3cd11d134edff34aa |