Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-90928: Improve static initialization of keywords tuple in AC #95907

Merged
merged 6 commits into from Aug 13, 2022

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Aug 11, 2022

Calculate num_keywords during template generation instead of leaving it to the preprocessor. This makes for much smaller and easier to read (FWIW) AC output.

See discussion in #95860 (comment)

Copy link
Member

@ericsnowcurrently ericsnowcurrently left a comment

Thanks for working on this! Mostly LGTM.

Also, can you drop "num_keywords" from template_dict now?

Tools/clinic/clinic.py Outdated Show resolved Hide resolved
Tools/clinic/clinic.py Outdated Show resolved Hide resolved
@bedevere-bot
Copy link

bedevere-bot commented Aug 11, 2022

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@erlend-aasland
Copy link
Contributor Author

erlend-aasland commented Aug 11, 2022

Also, can you drop "num_keywords" from template_dict now?

It is already dropped :)

@erlend-aasland
Copy link
Contributor Author

erlend-aasland commented Aug 11, 2022

I have made the requested changes; please review again.

@bedevere-bot
Copy link

bedevere-bot commented Aug 11, 2022

Thanks for making the requested changes!

@ericsnowcurrently: please review the changes made to this pull request.

@kumaraditya303 kumaraditya303 self-requested a review Aug 12, 2022
Copy link
Member

@ericsnowcurrently ericsnowcurrently left a comment

LGTM

I'll leave it up to you about the two comments I left.

Tools/clinic/clinic.py Outdated Show resolved Hide resolved
Tools/clinic/clinic.py Outdated Show resolved Hide resolved
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Tools/clinic/clinic.py Outdated Show resolved Hide resolved
@erlend-aasland
Copy link
Contributor Author

erlend-aasland commented Aug 12, 2022

Thanks for reviewing; highly appreciated. I'll make a quick adjustment before landing.

- inline len(keywords)
- use NUM_KEYWORDS constant for improved readability in generated code
@erlend-aasland
Copy link
Contributor Author

erlend-aasland commented Aug 12, 2022

I'm done with the last round of adjustments. I ended up adding both of your last suggestions. Thanks again.

@erlend-aasland
Copy link
Contributor Author

erlend-aasland commented Aug 12, 2022

FYI, I'll wait with merging until Kumar has finished his review.

Copy link
Contributor

@kumaraditya303 kumaraditya303 left a comment

LGTM, thanks!

@erlend-aasland
Copy link
Contributor Author

erlend-aasland commented Aug 13, 2022

Thanks for the reviews!

@erlend-aasland erlend-aasland merged commit f07adf8 into python:main Aug 13, 2022
13 checks passed
@erlend-aasland erlend-aasland deleted the improve-gh-95860 branch Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants