Download Python/train/3.13/param-spec/modern_02.py from SwashBuckler001/idiombench: direct link, hf CLI and curl.
- Browser
- Download file 421 Bytes
-
https://huggingface.co/datasets/SwashBuckler001/idiombench/resolve/main/Python/train/3.13/param-spec/modern_02.py
- Command line
-
hf download hf://datasets/SwashBuckler001/idiombench/Python/train/3.13/param-spec/modern_02.py
-
curl -L -o modern_02.py https://huggingface.co/datasets/SwashBuckler001/idiombench/resolve/main/Python/train/3.13/param-spec/modern_02.py
421 Bytes
| from typing import Concatenate | |
| def with_request(f: Callable[Concatenate[Request, P], R]) -> Callable[P, R]: | |
| def inner(*args: P.args, **kwargs: P.kwargs) -> R: | |
| return f(Request(), *args, **kwargs) | |
| return inner | |
| def takes_int_str(request: Request, x: int, y: str) -> int: | |
| # use request | |
| return x + 7 | |
| takes_int_str(1, "A") # Accepted | |
| takes_int_str("B", 2) # Correctly rejected by the type checker | |