Download Python/train/3.13/protocol/modern_18.py from SwashBuckler001/idiombench: direct link, hf CLI and curl.
- Browser
- Download file 299 Bytes
-
https://huggingface.co/datasets/SwashBuckler001/idiombench/resolve/main/Python/train/3.13/protocol/modern_18.py
- Command line
-
hf download hf://datasets/SwashBuckler001/idiombench/Python/train/3.13/protocol/modern_18.py
-
curl -L -o modern_18.py https://huggingface.co/datasets/SwashBuckler001/idiombench/resolve/main/Python/train/3.13/protocol/modern_18.py
299 Bytes
| from typing import Any, Protocol | |
| class ProtoA(Protocol): | |
| def meth(self, x: int) -> int: ... | |
| class ProtoB(Protocol): | |
| def meth(self, obj: Any, x: int) -> int: ... | |
| class C: | |
| def meth(self, x: int) -> int: ... | |
| a: ProtoA = C # Type check error, signatures don't match! | |
| b: ProtoB = C # OK | |