Skip to main content

Switch statements for Python

Project description


Dipswitch is a Python module allowing for switch-case statements with a similar structure to those in languages that natively support them.


from dipswitch import switch
for case in switch(2):
	if case(0):
		print("doesn't execute")
	if case(1):
		print("doesn't execute")
	if case(2):
	if case(3):
	if case(4):
		print("doesn't execute")
	if case.default():
		print("doesn't execute")

Project details

Release history Release notifications

This version
History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
dipswitch-1.0-py3-none-any.whl (3.1 kB) Copy SHA256 hash SHA256 Wheel py3
dipswitch-1.0.tar.gz (2.8 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page