Return the code to construct a value for a given CDP type.
(cls, cdp_type, val)
| 186 | |
| 187 | @classmethod |
| 188 | def get_constructor(cls, cdp_type, val): |
| 189 | """Return the code to construct a value for a given CDP type.""" |
| 190 | if cdp_type == "any": |
| 191 | return val |
| 192 | cons = cls[cdp_type].value |
| 193 | return f"{cons}({val})" |
| 194 | |
| 195 | |
| 196 | @dataclass |