Closed koct9i closed 1 year ago
Yeah, it's unfortunate, but that's the current API, and I don't think this is a good reason to break it. Also, dst option works a bit differently from how stream does in pyyaml.
Oh, although guess stream= can be easily supported alongside dst=, which didn't occur to me at first.
Should be fixed in 23.9.0, by checking if either stream or dst is passed (but not both), and defaulting to the same old "return str" behavior. Thanks for reporting!
There is tiny incompatibility with PyYAML:
PyYAML: dump(data, stream=None, ...) https://github.com/yaml/pyyaml/blob/main/lib/yaml/__init__.py#L248
pretty-yaml: dump(data, dst=None, ...) https://github.com/mk-fg/pretty-yaml/blob/master/pyaml/__init__.py#L164
As a result: