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
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
more-context-0.0.1.tar.gz
(1.8 kB
view hashes)
Built Distribution
Close
Hashes for more_context-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8643a6b993639444fe7013e305ebeac2a019ffa03d21796020fae0f4c18d628e |
|
MD5 | d3c9c19b5406afeddb41a4ee7f6153b5 |
|
BLAKE2b-256 | 5acf6c58710023f432711af61adcd699f60ba5319a9a6259b176d5d030bafe83 |