Showing content from http://mail.python.org/pipermail/python-dev/attachments/20180227/0eea1c81/attachment.html below:
<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, 27 Feb 2018 at 05:38 INADA Naoki <<a href="mailto:songofacandy@gmail.com">songofacandy@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, all.<br>
<br>
There is design discussion which is deferred blocker of 3.7.<br>
<a href="https://bugs.python.org/issue32911" rel="noreferrer" target="_blank">https://bugs.python.org/issue32911</a><br>
<br>
## Background<br>
<br>
An year ago, I moved docstring in AST from statements list to field of<br>
module, class and functions.<br>
<a href="https://bugs.python.org/issue29463" rel="noreferrer" target="_blank">https://bugs.python.org/issue29463</a><br>
<br>
Without this change, AST-level constant folding was complicated because<br>
"foo" can be docstring but "fo" + "o" can't be docstring.<br>
<br>
This simplified some other edge cases. For example, future import must<br>
be on top of the module, but docstring can be before it.<br>
Docstring is very special than other expressions/statement.<br>
<br>
Of course, this change was backward incompatible.<br>
Tools reading/writing docstring via AST will be broken by this change.<br>
For example, it broke PyFlakes, and PyFlakes solved it already.<br>
<br>
<a href="https://github.com/PyCQA/pyflakes/pull/273" rel="noreferrer" target="_blank">https://github.com/PyCQA/pyflakes/pull/273</a><br>
<br>
Since AST doesn't guarantee backward compatibility, we can change<br>
AST if it's reasonable.<br>
<br>
Last week, Mark Shannon reported issue about this backward incompatibility.<br>
As he said, this change losted lineno and column of docstring from AST.<br>
<br>
<a href="https://bugs.python.org/issue32911#msg312567" rel="noreferrer" target="_blank">https://bugs.python.org/issue32911#msg312567</a><br>
<br>
<br>
## Design discussion<br>
<br>
And as he said, there are three options:<br>
<br>
<a href="https://bugs.python.org/issue32911#msg312625" rel="noreferrer" target="_blank">https://bugs.python.org/issue32911#msg312625</a><br>
<br>
> It seems to be that there are three reasonable choices:<br>
> 1. Revert to 3.6 behaviour, with the addition of `docstring` attribute.<br>
> 2. Change the docstring attribute to an AST node, possibly by modifying the grammar.<br>
> 3. Do nothing.<br></blockquote><div><br></div><div>I'm +1 for #3, +0 for #2, -1 for #1. <br></div></div></div>
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4