A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2018-February/152319.html below:

[Python-Dev] Backward incompatible change about docstring AST

[Python-Dev] Backward incompatible change about docstring ASTBrett Cannon brett at python.org
Tue Feb 27 18:55:52 EST 2018
On Tue, 27 Feb 2018 at 05:38 INADA Naoki <songofacandy at gmail.com> wrote:

> Hi, all.
>
> There is design discussion which is deferred blocker of 3.7.
> https://bugs.python.org/issue32911
>
> ## Background
>
> An year ago, I moved docstring in AST from statements list to field of
> module, class and functions.
> https://bugs.python.org/issue29463
>
> Without this change, AST-level constant folding was complicated because
> "foo" can be docstring but "fo" + "o" can't be docstring.
>
> This simplified some other edge cases.  For example, future import must
> be on top of the module, but docstring can be before it.
> Docstring is very special than other expressions/statement.
>
> Of course, this change was backward incompatible.
> Tools reading/writing docstring via AST will be broken by this change.
> For example, it broke PyFlakes, and PyFlakes solved it already.
>
> https://github.com/PyCQA/pyflakes/pull/273
>
> Since AST doesn't guarantee backward compatibility, we can change
> AST if it's reasonable.
>
> Last week, Mark Shannon reported issue about this backward incompatibility.
> As he said, this change losted lineno and column of docstring from AST.
>
> https://bugs.python.org/issue32911#msg312567
>
>
> ## Design discussion
>
> And as he said, there are three options:
>
> https://bugs.python.org/issue32911#msg312625
>
> > It seems to be that there are three reasonable choices:
> > 1. Revert to 3.6 behaviour, with the addition of `docstring` attribute.
> > 2. Change the docstring attribute to an AST node, possibly by modifying
> the grammar.
> > 3. Do nothing.
>

I'm +1 for #3, +0 for #2, -1 for #1.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20180227/0eea1c81/attachment.html>
More information about the Python-Dev mailing list

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