tmt
tmt copied to clipboard
Refactor "to YAML" and "from YAML" helpers
- naming: use
to_yamlandfrom_yamlfirst, to be aligned with the rest of codebase (e.g.to_spec). -
to_yamlandfrom_yamlare the primary work horses: most of the time, caller does not care about the data types at all. -
yaml_to_listandyaml_to_dictsurvive, but may eventually become replaced with some Pydantic magic, as they are not just about dict or list, but also types of keys, values, and items, and our code cannot validate that. - YAML loader/dumper creation separated from its use. Eventually we may cache the object, but it's unknown whether the object itself can be used in multiple threads safely.
- some extra documentation, keyword-only arguments, etc.
Pull Request Checklist
- [x] implement the feature