Author serhiy.storchaka
Recipients Mark.Shannon, benjamin.peterson, georg.brandl, methane, ned.deily, rhettinger, serhiy.storchaka, vstinner
Date 2018-02-23.11:19:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I prefer 2 or 3. There are benefits from representing a docstring as a separate attribute. This simplifies the code for walking the AST tree (no longer special cases for skipping docstring in modules, classes and functions) and the code for retrieving a docstring. It solves the problem that an expression resulting to a constant string (like "a"+"b" or f"a") shouldn't be interpreted as docstrings.

The position of a docstring can be useful for determining the position of fragments inside a docstring (for example for doctests). Several active developed third-party libraries (like pyflakes, see already updated their code for supporting 3.7. The position of nodes preceding or following a docstring could be used. This is not perfect, it doesn't work with empty lines before or after docstring, but it never was perfect due to escaped newlines in string literals and line continuations.
Date User Action Args
2018-02-23 11:19:43serhiy.storchakasetrecipients: + serhiy.storchaka, georg.brandl, rhettinger, vstinner, benjamin.peterson, ned.deily, methane, Mark.Shannon
2018-02-23 11:19:43serhiy.storchakasetmessageid: <>
2018-02-23 11:19:43serhiy.storchakalinkissue32911 messages
2018-02-23 11:19:43serhiy.storchakacreate