An open API service indexing awesome lists of open source software.

https://github.com/3jackdaws/py-switchcase

Switchcases in Python! 100% in language, minimal hacks.
https://github.com/3jackdaws/py-switchcase

Last synced: over 1 year ago
JSON representation

Switchcases in Python! 100% in language, minimal hacks.

Awesome Lists containing this project

README

          

# Switchcase
Switch cases in python that aren't too weird.

# Usage
```py
from switchcase import switch

with switch(value) as case:

with case("foo"):
assert False

with case("bar"):
assert False

# default case must be last
with case.default:
print(":^)")
```

# Installation
py-switchcase is available on pypi.

`pip install py-switchcase`