mirror of
https://github.com/python/cpython.git
synced 2025-07-28 21:55:21 +00:00
bpo-32911: Revert bpo-29463. (GH-7121) (GH-7197)
Remove the docstring attribute of AST types and restore docstring expression as a first stmt in their body. Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
This commit is contained in:
parent
2179022d94
commit
73cbe7a01a
17 changed files with 3287 additions and 3358 deletions
|
@ -71,8 +71,6 @@ class Unparser:
|
|||
########################################################
|
||||
|
||||
def _Module(self, tree):
|
||||
if tree.docstring is not None:
|
||||
self.fill(repr(tree.docstring))
|
||||
for stmt in tree.body:
|
||||
self.dispatch(stmt)
|
||||
|
||||
|
@ -237,8 +235,6 @@ class Unparser:
|
|||
self.write(")")
|
||||
|
||||
self.enter()
|
||||
if t.docstring is not None:
|
||||
self.fill(repr(t.docstring))
|
||||
self.dispatch(t.body)
|
||||
self.leave()
|
||||
|
||||
|
@ -261,8 +257,6 @@ class Unparser:
|
|||
self.write(" -> ")
|
||||
self.dispatch(t.returns)
|
||||
self.enter()
|
||||
if t.docstring is not None:
|
||||
self.fill(repr(t.docstring))
|
||||
self.dispatch(t.body)
|
||||
self.leave()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue