[proxy] github.com← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light
/ cpython Public

Conversation

Copy link
Member

serhiy-storchaka commented May 12, 2018

  • Fix miscellaneous bugs in converting annotations to strings.
  • Optimize parenthesis in the string representation.
  • Clean up the C code.

https://bugs.python.org/issue33475

* Fix miscellaneous bugs in converting annotations to strings.
* Optimize parenthesis in the string representation.
* Clean up the C code.
Copy link
Member

@ambv should review it

@@ -0,0 +1,2 @@
Fixed miscellaneous bugs in onverting annotations to strings and optimize
Copy link
Member

Choose a reason for hiding this comment

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

converting, optimized (to make tense consistent), parentheses (on the next line)

ambv merged commit 64fddc4 into python:master May 17, 2018
Copy link
Contributor

Thanks @serhiy-storchaka for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

Copy link
Contributor

ambv commented May 17, 2018

Thanks for the PR, @serhiy-storchaka! I won't lie, I don't like the macros, I find them hiding actual control flow in the functions. But I won't argue with all the fixes you made.

Copy link
Contributor

Sorry, @serhiy-storchaka and @ambv, I could not cleanly backport this to 3.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 64fddc423fcbe90b8088446c63385ec0aaf3077c 3.7

Copy link
Contributor

ambv commented May 17, 2018

Oops, looks like 3.7 needs help.

serhiy-storchaka deleted the ast-unparse-omit-parens branch May 17, 2018 06:25
Copy link
Member Author

Thank you for merging the PR and sorry for using macros. My reasons are that they make the code clearer to me they are already used everywhere in the AST processing. In any case this patch changed virtually every line of the code. Macros can help to avoid such large changes in future (if we will add a hidden parameter passed to most functions) or can help to automate changes because they uses are one-line and well searchable.

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request May 17, 2018
…ythonGH-6774).

(cherry picked from commit 64fddc4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Copy link

GH-6927 is a backport of this pull request to the 3.7 branch.

serhiy-storchaka added a commit that referenced this pull request May 20, 2018
…H-6774). (GH-6927)

(cherry picked from commit 64fddc4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants