A string with """..."""
(triple quotes) is called a multiline string. There is a distinction between a multiline string and a docstring. The latter is a subset of the former.
The one in question is being assigned to a variable, so it is not a docstring. A docstring is what you'd find at the top of a function, like this:
def foo():
"""This is a doc-string"""
pass
And printing out foo.__doc__
gives you
print(foo.__doc__)
'This is a doc-string'
You should understand that only the first multiline string in a function (if it is un-assigned) becomes the docstring of a function (provided no optimisation switches are set) and the rest are all discarded.
In contrast,
message = """\
From: %s
To: %s
Subject: %s
%s
""" % (FROM, ", ".join(TO), SUBJECT, TEXT)
Happens to be a multi-line string with some C-style format arguments that is assigned to the variable message
.
Further reading: