stephenpardy / scopr

Ham-fisted scoping in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

scopr

Ham-fisted scoping in Python

Load it into your project and enjoy scopes anywhere:

from scopr import scope

a = 1  # define a variable outside the scope
with scope():
    a = 2  # redefine and use a variable here

print(a)  # prints 1

Works on CPython with Python 2 and 3, and on PyPy. CAUTION: This is mostly untested and definitely a bad idea.

About

Ham-fisted scoping in Python

License:MIT License


Languages

Language:Python 100.0%