Skip to content

cadojo/block-scopes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🩺 block-scopes

Block scoping in Python!

PyPI - Version PyPI - Python Version


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.

About

Block scoping in Python!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages