Python package for preventing use of variables from enclosing scope.
Project description
safescope
Python package for preventing use of variables from enclosing scope.
Free software: BSD license
Documentation: https://safescope.readthedocs.io.
Install
pip install safescope
Features
This is a package that can be used for preventing functions from using global variables, or variables from enclosing scopes. The functionality is only meant for use in notebooks, and not real code. Arguably, use of this package encourage bad programming habits…
Quickstart:
from safescope import assert_local_vars a = 0 @assert_local_vars def foo(): b = 5 return a + b
This should raise an error explaining that a is not in the function scope.
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2018-01-11)
First release on PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for safescope-0.1.6-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 595cc95afd92e78488b1e19bfd4ea049ac9f84c212246883369e13b0562c9954 |
|
MD5 | 6f6eb8b87a7cf3061a8760edeb598be2 |
|
BLAKE2b-256 | af7f1fbeb23b4e04ed10f6cde329378796c11a2fed2bd80c97cbda6503f6ebae |