Skip to main content

Python package for preventing use of variables from enclosing scope.

Project description

safescope

https://img.shields.io/pypi/v/safescope.svg https://img.shields.io/travis/havakv/safescope.svg Documentation Status Updates

Python package for preventing use of variables from enclosing scope.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

safescope-0.1.7.tar.gz (12.4 kB view hashes)

Uploaded Source

Built Distribution

safescope-0.1.7-py2.py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page