Skip to main content

conditional_context

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

Metadata

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)

Source distribution for conditional-context 1.0.1
File Size Uploaded Provenance
conditional_context-1.0.1.tar.gz 4.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for conditional-context 1.0.1
File Interpreter ABI Platform
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

Security for conditional-context 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page