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.

Source Distribution

dipswitch-1.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dipswitch-1.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

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

Hashes for dipswitch-1.0.tar.gz
Algorithm Hash digest
SHA256 30c53da24640e5a5880af66feb86454c848979ff2a786303c1c7113f1e682ea0
MD5 91ba784f9c562cf98e34c6d67d196c54
BLAKE2b-256 ca374825fbf31e41d841f87a3a67a7f3ff47f90c197265e87b961f50356dc9c1

See more details on using hashes here.

File details

Details for the file dipswitch-1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dipswitch-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e1206bdd8005e844f79e7410b57fa29d42b7ed557613cb5cd762bf07ba6e12b
MD5 9c377d3b90ae3469ccb6308bdc2c2098
BLAKE2b-256 3e921e8a91a3accf7288788a45f61dabf0c94ac746bc104ec7f8fe3d89b3bb8c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page