Here is an @file that I just made. Yes, the << ... >> sentinal is inside the quoted string. But I don't mind that as long as 1) Python sees the correct code, and 2) Leo can read the file and reproduce it. And that is currently the case, except that Leo may move one or the other of the triple quotes to its own line during a round trip, and that would be fine too.
Why am I interested in this? Mostly because PEP 8, the Python style guide, wants docstrings to start right after the triple quotes on the same line. I agree with this so I'd like to be possible. PEP8 also wants the ending triple quotes to be on the same line if the docstring is a single line, but you wouldn't be using a section reference for a short docstring anyway.
Of course, one could also put the triple quotes inside the section itself. I'm not sure how that works if the docstring section itself is a tree of nodes, but it probably does. You tend to get that kind of long, segmented docstring when the docstring is used directly for an About or Help display, as they are for Leo plugins.
#@+leo-ver=5-thin
#@+node:tom.20211105130433.1: * @file c:\temp\section_quotes.py
#@@language python
"""
#@+<< docstring >>
#@+node:tom.20211105130454.1: ** << docstring >>
This represents a long
doctring section.
#@-<< docstring >>
#@afterref
"""
# Code here
def f(x):
return x**2
#@-leo