Skip to main content

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

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for dipswitch, version 1.0
Filename, size File type Python version Upload date Hashes
Filename, size dipswitch-1.0-py3-none-any.whl (3.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size dipswitch-1.0.tar.gz (2.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page