Search code examples
yaml

Any issues with using ''' block string for block commenting in yaml?


I have been using ''' for block comments in yaml. Like:

'''
This
is 
a
comment
'''

I have noticed that this approach isn't one of the answers to the How do you block comment in yaml question. Is there a reason why not to do this (other than terrible multiline string formating glitches in VIM)? Does it get loaded into memory or something else that could be problematic?


Solution

  • Based on the spec, use # only: http://yaml.org/spec/1.2/spec.html#comment/

    As to why? Short of 'Because they said so' I would guess that some of the readability of YAML is lost with multiline comments.

    You're use of ''' is the standard for Python docstrings.