GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-32911: Add new AST node for docstring by methane · Pull Request #5927 · python/cpython

Conversation

@methane

@methane methane commented Feb 27, 2018 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

https://bugs.python.org/issue32911

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
methane added 2 commits February 27, 2018 20:53
@methane
bpo-32911: Add new AST node for docstring
b4838fe
@methane
Add NEWS entry
c7bfbfc
@bedevere-bot bedevere-bot added the awaiting merge label Feb 27, 2018
@methane
methane requested a review from serhiy-storchaka February 27, 2018 11:59
@methane
make regen-all
4f49c19
@methane

methane commented Feb 27, 2018

Copy link
Copy Markdown
Member Author

Some changes are not PEP 7 compliant because I've copied from old code before GH-46.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

serhiy-storchaka
serhiy-storchaka approved these changes Mar 2, 2018
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Python/ast.c Outdated
}
}
return NULL;
return 0;

@serhiy-storchaka serhiy-storchaka Feb 27, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Python/compile.c
if (find_ann(stmts)) {
ADDOP(c, SETUP_ANNOTATIONS);
}
if (!asdl_seq_LEN(stmts))

@serhiy-storchaka serhiy-storchaka Feb 27, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@methane methane Mar 6, 2018

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for 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)

cpython/Python/compile.c

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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Tools/parser/unparse.py Outdated

def _DocString(self, t):
self.fill()
self.write(repr(t.s))

@serhiy-storchaka serhiy-storchaka Feb 27, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not fill()?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@methane
Update based on PR comments.
4e11dd2
@methane methane closed this Mar 20, 2018
@serhiy-storchaka serhiy-storchaka mentioned this pull request May 25, 2018
bpo-32911: Remove the docstring attribute of AST types #7121
Merged
@methane
methane deleted the ast-docstring-node branch June 11, 2019 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@serhiy-storchaka serhiy-storchaka serhiy-storchaka approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting merge

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@methane @serhiy-storchaka @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.