Datasets:
Download Python/train/3.13/param-spec/legacy_01.py from SwashBuckler001/idiombench: direct link, hf CLI and curl.
- Browser
- Download file 413 Bytes
-
https://huggingface.co/datasets/SwashBuckler001/idiombench/resolve/main/Python/train/3.13/param-spec/legacy_01.py
- Command line
-
hf download hf://datasets/SwashBuckler001/idiombench/Python/train/3.13/param-spec/legacy_01.py
-
curl -L -o legacy_01.py https://huggingface.co/datasets/SwashBuckler001/idiombench/resolve/main/Python/train/3.13/param-spec/legacy_01.py
413 Bytes
| from typing import Awaitable, Callable, TypeVar | |
| R = TypeVar("R") | |
| def add_logging(f: Callable[..., R]) -> Callable[..., Awaitable[R]]: | |
| async def inner(*args: object, **kwargs: object) -> R: | |
| await log_to_database() | |
| return f(*args, **kwargs) | |
| return inner | |
| def takes_int_str(x: int, y: str) -> int: | |
| return x + 7 | |
| await takes_int_str(1, "A") | |
| await takes_int_str("B", 2) # fails at runtime | |