Switch statements for Python
Project description
Dipswitch
Dipswitch is a Python module allowing for switch-case statements with a similar structure to those in languages that natively support them.
Usage
from dipswitch import switch
for case in switch(2):
if case(0):
print("doesn't execute")
if case(1):
print("doesn't execute")
break
if case(2):
print("executes")
if case(3):
print("executes")
break
if case(4):
print("doesn't execute")
break
if case.default():
print("doesn't execute")
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
dipswitch-1.0.tar.gz
(2.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dipswitch-1.0.tar.gz.
File metadata
- Download URL: dipswitch-1.0.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30c53da24640e5a5880af66feb86454c848979ff2a786303c1c7113f1e682ea0
|
|
| MD5 |
91ba784f9c562cf98e34c6d67d196c54
|
|
| BLAKE2b-256 |
ca374825fbf31e41d841f87a3a67a7f3ff47f90c197265e87b961f50356dc9c1
|
File details
Details for the file dipswitch-1.0-py3-none-any.whl.
File metadata
- Download URL: dipswitch-1.0-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e1206bdd8005e844f79e7410b57fa29d42b7ed557613cb5cd762bf07ba6e12b
|
|
| MD5 |
9c377d3b90ae3469ccb6308bdc2c2098
|
|
| BLAKE2b-256 |
3e921e8a91a3accf7288788a45f61dabf0c94ac746bc104ec7f8fe3d89b3bb8c
|