Download Python/train/3.8/protocol/modern_13.py from SwashBuckler001/idiombench: direct link, hf CLI and curl.
- Browser
- Download file 487 Bytes
-
https://huggingface.co/datasets/SwashBuckler001/idiombench/resolve/main/Python/train/3.8/protocol/modern_13.py
- Command line
-
hf download hf://datasets/SwashBuckler001/idiombench/Python/train/3.8/protocol/modern_13.py
-
curl -L -o modern_13.py https://huggingface.co/datasets/SwashBuckler001/idiombench/resolve/main/Python/train/3.8/protocol/modern_13.py
487 Bytes
| from typing import Optional, List, Protocol | |
| class Combiner(Protocol): | |
| def __call__(self, *vals: bytes, | |
| maxlen: Optional[int] = None) -> List[bytes]: ... | |
| def good_cb(*vals: bytes, maxlen: Optional[int] = None) -> List[bytes]: | |
| ... | |
| def bad_cb(*vals: bytes, maxitems: Optional[int]) -> List[bytes]: | |
| ... | |
| comb: Combiner = good_cb # OK | |
| comb = bad_cb # Error! Argument 2 has incompatible type because of | |
| # different name and kind in the callback | |