Block scopes in Python? Whaaaaaat?!
Project description
🩺 block-scopes
Block scoping in Python!
Table of Contents
Usage
from scopes import scope
before = "I'll be kept!"
with scope("keep_me", "keep_me_too"):
keep_me = "Keep me!"
lose_me = "Not me!"
keep_me_too = "Also... me!"
assert "before" in locals()
assert "keep_me" in locals()
assert "keep_me_too" in locals()
assert "lose_me" not in locals()
Installation
pip install block-scopes
License
block-scopes
is distributed under the terms of the MIT license.
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
block_scopes-0.2.0.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for block_scopes-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05fbbe7b01bd80a0f6b9c352c7b35541725015d41dd023a2d4b0dd1320e8a414 |
|
MD5 | e176db477b42832d51abe028b91c0f16 |
|
BLAKE2b-256 | 8dbf115d5df53a6980af7d33ea8531a66451754959b75951fc39d9823baf20cc |