Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

tadzik/switch4python

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

A switch "statement" for Python. Please don't actually use this.

x = 5

switch(x)

if case(4):
    assert False

if case(5):
    assert True
    fallthrough()

if case(lambda x: x > 3):
    assert True

if case(6):
    assert False

if default():
    assert False

Tests and usage in test.py.

About

Leave while you still can.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.