Skip to main content

Block scopes in Python? Whaaaaaat?!

Project description

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

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

block_scopes-0.2.3.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

block_scopes-0.2.3-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file block_scopes-0.2.3.tar.gz.

File metadata

  • Download URL: block_scopes-0.2.3.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.9

File hashes

Hashes for block_scopes-0.2.3.tar.gz
Algorithm Hash digest
SHA256 3cbaf996b3811cf929d11a93321462cc9c2473d1bc6fa7dda0050cead3581eb6
MD5 e0fa1b26e3550849dfbb1f6008f92b31
BLAKE2b-256 ed60830b7d07f180a1b62ed4dcb392e41af6e54ea67d3c793894863246b5242a

See more details on using hashes here.

File details

Details for the file block_scopes-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: block_scopes-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.9

File hashes

Hashes for block_scopes-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 97bfe3f6e41e0813cd077a4ed927de580755945b36f2aa66c82ef5502c3f0b75
MD5 0e9e549a48505f7f6187b03dac8ecee6
BLAKE2b-256 4d5c1119729eca2ff8279da4b349e8f22e521f6b3e2672ca57696c84c2a8651a

See more details on using hashes here.

Supported by

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