Download Python/train/3.14/pattern-matching/modern_15.py from SwashBuckler001/idiombench: direct link, hf CLI and curl.
- Browser
- Download file 303 Bytes
-
https://huggingface.co/datasets/SwashBuckler001/idiombench/resolve/main/Python/train/3.14/pattern-matching/modern_15.py
- Command line
-
hf download hf://datasets/SwashBuckler001/idiombench/Python/train/3.14/pattern-matching/modern_15.py
-
curl -L -o modern_15.py https://huggingface.co/datasets/SwashBuckler001/idiombench/resolve/main/Python/train/3.14/pattern-matching/modern_15.py
303 Bytes
| match points: | |
| case []: | |
| print("No points") | |
| case [Point(0, 0)]: | |
| print("The origin") | |
| case [Point(x, y)]: | |
| print(f"Single point {x}, {y}") | |
| case [Point(0, y1), Point(0, y2)]: | |
| print(f"Two on the Y axis at {y1}, {y2}") | |
| case _: | |
| print("Something else") | |