Author inada.naoki
Recipients Mark.Shannon, benjamin.peterson, georg.brandl, inada.naoki, ned.deily, rhettinger, serhiy.storchaka, vstinner
Date 2018-02-27.09:38:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1519724284.49.0.467229070634.issue32911@psf.upfronthosting.co.za>
In-reply-to
Content
I tried this patch:

diff --git a/Python/ast.c b/Python/ast.c
index e2092f0f85..93be2bc839 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -3537,9 +3537,9 @@ docstring_from_stmts(asdl_seq *stmts)
         if (s->kind == Expr_kind && s->v.Expr.value->kind == Str_kind) {
             string doc = s->v.Expr.value->v.Str.s;
             /* not very efficient, but simple */
-            memmove(&asdl_seq_GET(stmts, 0), &asdl_seq_GET(stmts, 1),
-                    (stmts->size - 1) * sizeof(void*));
-            stmts->size--;
+            //memmove(&asdl_seq_GET(stmts, 0), &asdl_seq_GET(stmts, 1),
+            //        (stmts->size - 1) * sizeof(void*));
+            //stmts->size--;
             return doc;
         }
     }

But I got "SyntaxError: from __future__ imports must occur at the beginning of the file".

docstring is very special while it looks like just a single string literal statement...
History
Date User Action Args
2018-02-27 09:38:04inada.naokisetrecipients: + inada.naoki, georg.brandl, rhettinger, vstinner, benjamin.peterson, ned.deily, Mark.Shannon, serhiy.storchaka
2018-02-27 09:38:04inada.naokisetmessageid: <1519724284.49.0.467229070634.issue32911@psf.upfronthosting.co.za>
2018-02-27 09:38:04inada.naokilinkissue32911 messages
2018-02-27 09:38:04inada.naokicreate