-
Notifications
You must be signed in to change notification settings - Fork 551
Proposal for solving issue #379 #885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…alse having no impact on small dump)
yaml#379: Issue with explicit_end set to False having no impact on small dump
|
It has been explained in #379 that the current behaviour is necessary because of the YAML 1.1 spec. |
I can't see it is necessary because of the spec. I only see it's necessary for concatenating. Even the example in the post doesn't have the end marks for the second value - why? I just want to be able to produce a single-document output which is shown to the user. and they consistently ask me what these dots are for
|
because the important part in this example was the part after the first document and before the second document. |
|
What I read from the spec:
No word about "must", "required", etc. pyyaml calls itself a "full-featured" framework, so where comes this resistance from against an optional feature? Or differently asked: there is the |
|
I think the So, in YAML 1.2, the In my own YAML 1.2 emitter, I have two cases when I emit I also have an I think it would be possible to change PyYAML to that behaviour and still be compatible with YAML 1.1 (it would emit |
|
I don't know if this is rare. I came across this because I'm using https://github.com/null-none/django-yaml-field. It's just one out of hundreds use cases where pyyaml could be helpful - some of them need these markers, others of them obviously don't need them. that's why developers implement configurations and arguments. personally, I prefer this flexibility over duplicating code (forking or re-implementing) |
The cases I meant are really rare. In this case the string has 3 linebreaks at the end. The I would make a PR if there are chances of this getting merged, but I don't know if the maintainers have resources for making a new release. |

#379: Issue with explicit_end set to False having no impact on small dump
Warning: this change is not tested yet
Any input is welcome ;)