Download Python/train/3.13/dataclass-transform/modern_05.py from SwashBuckler001/idiombench: direct link, hf CLI and curl.
- Browser
- Download file 574 Bytes
-
https://huggingface.co/datasets/SwashBuckler001/idiombench/resolve/main/Python/train/3.13/dataclass-transform/modern_05.py
- Command line
-
hf download hf://datasets/SwashBuckler001/idiombench/Python/train/3.13/dataclass-transform/modern_05.py
-
curl -L -o modern_05.py https://huggingface.co/datasets/SwashBuckler001/idiombench/resolve/main/Python/train/3.13/dataclass-transform/modern_05.py
574 Bytes
| # Indicate that classes that derive from this class default to | |
| # synthesizing comparison methods. | |
| class ModelBase: | |
| def __init_subclass__( | |
| cls, | |
| *, | |
| init: bool = True, | |
| frozen: bool = False, | |
| eq: bool = True, | |
| order: bool = True, | |
| ): | |
| ... | |
| # Example of how this class would be used by code that imports | |
| # from this library: | |
| class CustomerModel( | |
| ModelBase, | |
| init=False, | |
| frozen=True, | |
| eq=False, | |
| order=False, | |
| ): | |
| id: int | |
| name: str | |