[issue33745] 3.7.0b5 changes the line number of empty functions with docstrings

Nick Coghlan report at bugs.python.org
Tue Jun 5 10:41:54 EDT 2018


Nick Coghlan <ncoghlan at gmail.com> added the comment:

While I wouldn't describe this as completely intentional (as it's an artifact of the change-and-revert dance with 3.7 previously removing docstring nodes from the AST entirely), I also wouldn't want to change it again at this late stage of the release process.

Instead I'd suggest simply noting it in the porting section of What's New. Something like "Due to a change in the way docstrings are handled by the compiler, the implicit ``return None`` in a function body consisting solely of a docstring is now marked as occurring on the same line as the docstring, not on the function's header line".

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33745>
_______________________________________


More information about the Python-bugs-list mailing list