Download Python/train/3.13/dataclass-transform/modern_06.py from SwashBuckler001/idiombench: direct link, hf CLI and curl.
- Browser
- Download file 661 Bytes
-
https://huggingface.co/datasets/SwashBuckler001/idiombench/resolve/main/Python/train/3.13/dataclass-transform/modern_06.py
- Command line
-
hf download hf://datasets/SwashBuckler001/idiombench/Python/train/3.13/dataclass-transform/modern_06.py
-
curl -L -o modern_06.py https://huggingface.co/datasets/SwashBuckler001/idiombench/resolve/main/Python/train/3.13/dataclass-transform/modern_06.py
661 Bytes
| # Indicate that classes that use this metaclass default to | |
| # synthesizing comparison methods. | |
| class ModelMeta(type): | |
| def __new__( | |
| cls, | |
| name, | |
| bases, | |
| namespace, | |
| *, | |
| init: bool = True, | |
| frozen: bool = False, | |
| eq: bool = True, | |
| order: bool = True, | |
| ): | |
| ... | |
| class ModelBase(metaclass=ModelMeta): | |
| ... | |
| # 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 | |