I have a yaml file that looks like this:
# The following key opens a door
PyYAML throws away comments at a very low level (in
While you could adapt or extend it to handle comments in its whole stack, this would be a major modification.
Dumping (=emitting) comments seems to be easier and is already being discussed.