Skip to main content

More Context

Project description

More Context

Context utilities

Installation

pip install more-context

Usage

Safe Context Manager

Like @contextmanager, but safe.

Code like this:

@safe_context_manager
def my_ctx():
    lock = lock_resource()
    yield
    lock.delete()

Is equivalent to:

@contextmanager
def my_ctx():
    lock = lock_resource()
    try:
        yield
    finally:
        lock.delete()

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

more-context-0.0.1.tar.gz (1.8 kB view details)

Uploaded Source

Built Distribution

more_context-0.0.1-py3-none-any.whl (2.0 kB view details)

Uploaded Python 3

File details

Details for the file more-context-0.0.1.tar.gz.

File metadata

  • Download URL: more-context-0.0.1.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for more-context-0.0.1.tar.gz
Algorithm Hash digest
SHA256 156fa37eabca15550bc4bee692eaa14ee09f4ff49030d2bc2cd22d9c5e0502c7
MD5 ee7f285e19f527de4f4ed4e433d45bb8
BLAKE2b-256 5f7d25a25b29344642a743e0242959f33bc4000e844bf1851c2aa012cf76ea56

See more details on using hashes here.

File details

Details for the file more_context-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: more_context-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for more_context-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8643a6b993639444fe7013e305ebeac2a019ffa03d21796020fae0f4c18d628e
MD5 d3c9c19b5406afeddb41a4ee7f6153b5
BLAKE2b-256 5acf6c58710023f432711af61adcd699f60ba5319a9a6259b176d5d030bafe83

See more details on using hashes here.

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