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.
- Host: GitHub
- URL: https://github.com/3jackdaws/py-switchcase
- Owner: 3jackdaws
- Created: 2018-10-14T00:19:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-14T01:09:18.000Z (over 7 years ago)
- Last Synced: 2025-01-28T21:35:03.691Z (over 1 year ago)
- Language: Python
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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`