🩺 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.