Context manager that will skip the body on a condition.
All code is in conditional_context/__init__.py
from conditional_context import condition
print('start')
value = True
with condition(False):
value = False
print('here') # Will not print
print('end')
assert value
import conditional_context
class MyContext(conditional_context.ConditionalContext):
def should_skip(self):
return True
print('start')
value = True
with MyContext():
value = False
print('here') # Will not print
print('end')
assert value
Release files for conditional-context 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| conditional_context-1.0.1.tar.gz | 4.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| conditional_context-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.6 kB
Release files / conditional_context-1.0.1.tar.gz
| Download URL | conditional_context-1.0.1.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a1ceab6802206e877ad4dbeb62cabfce07674cb6d9f423b7189c3302b25b02a
|
|
BLAKE2b-256 checksum How to use checksums |
5ce268c9d1d58b7df7acd39518bdb3c3d57767d5b36b1e49d342db437a87c0fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8
|
Release files / conditional_context-1.0.1-py3-none-any.whl
| Download URL | conditional_context-1.0.1-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b7b9ead3694c07c0940e4197c2ab408c67857603b245fa0a02370810295a9a96
|
|
BLAKE2b-256 checksum How to use checksums |
21f472442bf4ad20287a3157d48196a64206fe1ce50cb9546727600c088457b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8
|