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 hashes)

Uploaded Source

Built Distribution

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

Uploaded 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