No project description provided
Project description
switch_case
Installation
pip3 install switch_case
Usage
from switch_case import *
reason = (
switch
| case(_ == 200) >> 'OK'
| case(_ == 500) >> 'ERROR'
| default >> 'UNKNOWN')
assert reason(200) == 'OK'
assert reason(500) == 'ERROR'
assert reason(400) == 'UNKNOWN'
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
switch_case-1.0.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for switch_case-1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c088082c61d109a57a0f2e327f222ef525d2b3ab2a5abbdbf3d4c31088df2aec |
|
MD5 | c8a771fccea7dbece0f3257082600888 |
|
BLAKE2b-256 | 6940011f8931148ff208b4e4949475800fb7663e999e271565cd4a152286f1fe |