I’d like to be able to dump a dictionary containing long strings that I’d like to have in the block style for readability. For example:
foo: |
this is a
block literal
bar: >
this is a
folded block
PyYAML supports the loading of documents with this style but I can’t seem to find a way to dump documents this way. Am I missing something?
The result:
For completeness, one should also have str implementations, but I’m going to be lazy 🙂