This is not comment string but doc string.
PEP 257:
def func() """ This is a valid documentation string. It's called documentation string not a comment. It's not ignored by the Python interpreter. It's become a part of the object. """ passAs you know func.__doc__ contains this doc string. And beeng a string it is evaluated. I prefer to escape the backslash but perhaps depends on the case.
PEP 257:
Quote:For consistency, always use """triple double quotes""" around docstrings. Use r"""raw triple double quotes""" if you use any backslashes in your docstrings. For Unicode docstrings, use u"""Unicode triple-quoted strings""".