GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — bpo-32911: Add new AST node for docstring by methane · Pull Request #5927 · python/cpython Conversation
|
|
Some changes are not PEP 7 compliant because I've copied from old code before GH-46. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Added few nitpicks, but LGTM in general!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
| } | ||
| return NULL; | ||
| return 0; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Functions in this file usually return 1 on success and 0 on error (except functions which need to return a non-negative index on success).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (find_ann(stmts)) { | ||
| ADDOP(c, SETUP_ANNOTATIONS); | ||
| } | ||
| if (!asdl_seq_LEN(stmts)) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Maybe move this to the bottom of this function?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This should be before asdl_seq_GET.
And this code is copied back from 3.6. (There are extra blank line, I'll remove it)
Lines 1457 to 1459 in baa4507
| if (!asdl_seq_LEN(stmts)) | |
| return 1; | |
| st = (stmt_ty)asdl_seq_GET(stmts, 0); |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| def _DocString(self, t): | ||
| self.fill() | ||
| self.write(repr(t.s)) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Why not fill()?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.