YAML comments are started with #
separated from other tokens with whitespace and terminate at the end of line
If you do:
'''
This
is
a
comment
'''
You specify a scalar node, that starts and ends with one (1) single quote. That is because in single quoted style scalar nodes, you can insert a single quote by escaping it with a single quote. Since YAML does line unwrapping the above loads as the string ' This is a comment '
(the string including the quotes).
However if you insert that as comment after a scalar node like 42
as in:
answer: 42 '''
This
is
a
comment
'''
You still have valid YAML, but this will load e.g. in Python as a dict with a key answer
and an associated value of 42 ''' This is a comment '''
. A string, which would probably give you some error if you expected the integer value 42
.