Skip to content

Latest commit

 

History

History
18 lines (15 loc) · 377 Bytes

README.md

File metadata and controls

18 lines (15 loc) · 377 Bytes

A switch "statement" for Python.

x = 5

with switch(x) as case:
    if case(4):
        assert False
    if case(5):
        assert True
        case.fallthrough()
    if case(lambda x: x > 3):
        assert True
    if case(6):
        assert False
    if case.default():
        assert False

Tests and usage in test.py.