Download Python/train/3.13/dataclass-transform/modern_07.py from SwashBuckler001/idiombench: direct link, hf CLI and curl.
- Browser
- Download file 815 Bytes
-
https://huggingface.co/datasets/SwashBuckler001/idiombench/resolve/main/Python/train/3.13/dataclass-transform/modern_07.py
- Command line
-
hf download hf://datasets/SwashBuckler001/idiombench/Python/train/3.13/dataclass-transform/modern_07.py
-
curl -L -o modern_07.py https://huggingface.co/datasets/SwashBuckler001/idiombench/resolve/main/Python/train/3.13/dataclass-transform/modern_07.py
815 Bytes
| # Library code (within type stub or inline) | |
| # In this library, passing a resolver means that init must be False, | |
| # and the overload with Literal[False] enforces that. | |
| def model_field( | |
| *, | |
| default: Optional[Any] = ..., | |
| resolver: Callable[[], Any], | |
| init: Literal[False] = False, | |
| ) -> Any: ... | |
| def model_field( | |
| *, | |
| default: Optional[Any] = ..., | |
| resolver: None = None, | |
| init: bool = True, | |
| ) -> Any: ... | |
| def create_model( | |
| *, | |
| init: bool = True, | |
| ) -> Callable[[Type[_T]], Type[_T]]: ... | |
| # Code that imports this library: | |
| class CustomerModel: | |
| id: int = model_field(resolver=lambda : 0) | |
| name: str | |